mirror of
https://github.com/plutov/paypal.git
synced 2025-02-02 15:10:36 +01:00
new types
This commit is contained in:
parent
0277b266bf
commit
71e0a81e64
8
payment.go
Normal file
8
payment.go
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
package paypalsdk
|
||||||
|
|
||||||
|
import ()
|
||||||
|
|
||||||
|
// CreateDirectCreditCardPatment sends request with payment
|
||||||
|
func CreateDirectCreditCardPatment(cc CreditCrad, amount Amount) error {
|
||||||
|
return nil
|
||||||
|
}
|
21
types.go
21
types.go
|
@ -1,11 +1,10 @@
|
||||||
package paypalsdk
|
package paypalsdk
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// APIBaseSandBox points to the sandbox (for testing) version of the API
|
// APIBaseSandBox points to the sandbox (for testing) version of the API
|
||||||
APIBaseSandBox = "https://api.sandbox.paypal.com"
|
APIBaseSandBox = "https://api.sandbox.paypal.com"
|
||||||
|
@ -51,11 +50,27 @@ type (
|
||||||
Details []ErrorDetail `json:"details"`
|
Details []ErrorDetail `json:"details"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErrorDetails map to error_details object
|
// ErrorDetail map to error_details object
|
||||||
ErrorDetail struct {
|
ErrorDetail struct {
|
||||||
Field string `json:"field"`
|
Field string `json:"field"`
|
||||||
Issue string `json:"issue"`
|
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
|
// Error method implementation for ErrorResponse struct
|
||||||
|
|
Loading…
Reference in New Issue
Block a user