func (p *PayPalAdapter) Pay(fromEmail, toEmail string, amount float64) error {
	return p.Payment.Send(fromEmail, toEmail, &paypal.Money{Amount: amount, Currency: "USD"})
}
Pay from email to email this amount
package main
import (
	"fmt"
	"time"
	"github.com/going/toolkit/log"
	"github.com/svett/golang-design-patterns/structural-patterns/adapter/paybuddy/bank"
	"github.com/svett/golang-design-patterns/structural-patterns/adapter/paybuddy/paypal"
)
type Payment interface {
	Pay(fromEmail, toEmail string, amount float64) error
}
type Item struct {
	Name string
	Price float64
}
type ShoppingCard struct {
	Items []*Item
	PaymentMethod Payment
	ShopEmailAddress string
}
func (c *ShoppingCard) Checkout(payeeEmail string) error {
	var total float64
	for _, item := range c.Items {
		total += item.Price
	}
	return c.PaymentMethod.Pay(payeeEmail, c.ShopEmailAddress, total)
}
type BankAdapter struct {
	Gateway *bank.Gateway
}
func (b *BankAdapter) Pay(fromEmail, toEmail string, amount float64) error {
	fromAccount, err := b.Gateway.FindAccountByEmail(fromEmail)
	if err != nil {
		return err
	}
	toAccount, err := b.Gateway.FindAccountByEmail(toEmail)
	if err != nil {
		return err
	}
	t := &bank.Transaction{
		FromAccount: fromAccount,
		ToAccount:   toAccount,
		Amount:      amount,
		Date:        time.Now(),
		Reason:      "Payment to Online Store",
	}
	return b.Gateway.ProcessTransaction(t)
}
type PayPalAdapter struct {
	Payment *paypal.Payment
}