new types

This commit is contained in:
Aliaksandr Pliutau 2015-10-23 09:29:36 +07:00
parent 0277b266bf
commit 71e0a81e64
2 changed files with 68 additions and 45 deletions

8
payment.go Normal file
View File

@ -0,0 +1,8 @@
package paypalsdk
import ()
// CreateDirectCreditCardPatment sends request with payment
func CreateDirectCreditCardPatment(cc CreditCrad, amount Amount) error {
return nil
}

View File

@ -1,11 +1,10 @@
package paypalsdk
import (
"net/http"
"fmt"
"net/http"
)
const (
// APIBaseSandBox points to the sandbox (for testing) version of the API
APIBaseSandBox = "https://api.sandbox.paypal.com"
@ -51,11 +50,27 @@ type (
Details []ErrorDetail `json:"details"`
}
// ErrorDetails map to error_details object
// ErrorDetail map to error_details object
ErrorDetail struct {
Field string `json:"field"`
Issue string `json:"issue"`
}
// CreditCrad - All info about customer's CC
CreditCrad struct {
Type string
Number string
ExpireYear int
ExpireMonth int
FirstName string
LastName string
}
// Amount to pay
Amount struct {
Currency string
Amount float32
}
)
// Error method implementation for ErrorResponse struct