5
5
6
6
"github.com/checkout/checkout-sdk-go/common"
7
7
"github.com/checkout/checkout-sdk-go/payments"
8
+
9
+ "github.com/checkout/checkout-sdk-go/payments/nas"
8
10
)
9
11
10
12
const HostedPaymentsPath = "hosted-payments"
@@ -19,34 +21,37 @@ const (
19
21
20
22
type (
21
23
HostedPaymentRequest struct {
22
- Amount int `json:"amount,omitempty"`
23
- Currency common.Currency `json:"currency,omitempty"`
24
- PaymentType payments.PaymentType `json:"payment_type,omitempty,omitempty"`
25
- PaymentIp string `json:"payment_ip,omitempty"`
26
- BillingDescriptor * payments.BillingDescriptor `json:"billing_descriptor,omitempty"`
27
- Reference string `json:"reference,omitempty"`
28
- Description string `json:"description,omitempty"`
29
- DisplayName string `json:"display_name,omitempty"`
30
- Customer * common.CustomerRequest `json:"customer,omitempty"`
31
- Shipping * payments.ShippingDetails `json:"shipping,omitempty"`
32
- Billing * payments.BillingInformation `json:"billing,omitempty"`
33
- Recipient * payments.PaymentRecipient `json:"recipient,omitempty"`
34
- Processing * payments.ProcessingSettings `json:"processing,omitempty"`
35
- AllowPaymentMethods []payments.SourceType `json:"allow_payment_methods,omitempty"`
36
- DisabledPaymentMethods []payments.SourceType `json:"disabled_payment_methods,omitempty"`
37
- Products []payments.Product `json:"products,omitempty"`
38
- Risk * payments.RiskRequest `json:"risk,omitempty"`
39
- SuccessUrl string `json:"success_url,omitempty"`
40
- CancelUrl string `json:"cancel_url,omitempty"`
41
- FailureUrl string `json:"failure_url,omitempty"`
42
- Metadata map [string ]interface {} `json:"metadata,omitempty"`
43
- Locale string `json:"locale,omitempty"`
44
- ThreeDs * payments.ThreeDsRequest `json:"3ds,omitempty"`
45
- Capture bool `json:"capture,omitempty"`
46
- CaptureOn * time.Time `json:"capture_on,omitempty"`
47
- //Not available on previous
48
- ProcessingChannelId string `json:"processing_channel_id,omitempty"`
49
- AmountAllocations []common.AmountAllocations `json:"amount_allocations,omitempty"`
24
+ Currency common.Currency `json:"currency,omitempty"`
25
+ Billing * payments.BillingInformation `json:"billing,omitempty"`
26
+ SuccessUrl string `json:"success_url,omitempty"`
27
+ CancelUrl string `json:"cancel_url,omitempty"`
28
+ FailureUrl string `json:"failure_url,omitempty"`
29
+ Amount int `json:"amount,omitempty"`
30
+ PaymentType payments.PaymentType `json:"payment_type,omitempty,omitempty"`
31
+ PaymentIp string `json:"payment_ip,omitempty"`
32
+ BillingDescriptor * payments.BillingDescriptor `json:"billing_descriptor,omitempty"`
33
+ Reference string `json:"reference,omitempty"`
34
+ Description string `json:"description,omitempty"`
35
+ DisplayName string `json:"display_name,omitempty"`
36
+ ProcessingChannelId string `json:"processing_channel_id,omitempty"`
37
+ AmountAllocations []common.AmountAllocations `json:"amount_allocations,omitempty"`
38
+ Customer * common.CustomerRequest `json:"customer,omitempty"`
39
+ Shipping * payments.ShippingDetails `json:"shipping,omitempty"`
40
+ Recipient * payments.PaymentRecipient `json:"recipient,omitempty"`
41
+ Processing * payments.ProcessingSettings `json:"processing,omitempty"`
42
+ AllowPaymentMethods []payments.SourceType `json:"allow_payment_methods,omitempty"`
43
+ DisabledPaymentMethods []payments.SourceType `json:"disabled_payment_methods,omitempty"`
44
+ Products []payments.Product `json:"products,omitempty"`
45
+ Risk * payments.RiskRequest `json:"risk,omitempty"`
46
+ CustomerRetry * payments.PaymentRetryRequest `json:"customer_retry,omitempty"`
47
+ Sender * nas.Sender `json:"sender,omitempty"`
48
+ Metadata map [string ]interface {} `json:"metadata,omitempty"`
49
+ Locale payments.LocalType `json:"locale,omitempty"`
50
+ ThreeDs * payments.ThreeDsRequest `json:"3ds,omitempty"`
51
+ Capture bool `json:"capture,omitempty"`
52
+ CaptureOn * time.Time `json:"capture_on,omitempty"`
53
+ Instruction * payments.PaymentInstruction `json:"instruction,omitempty"`
54
+ PaymentMethodConfiguration * payments.PaymentMethodConfiguration `json:"payment_method_configuration,omitempty"`
50
55
}
51
56
)
52
57
@@ -60,23 +65,22 @@ type (
60
65
}
61
66
62
67
HostedPaymentDetails struct {
63
- HttpMetadata common.HttpMetadata
64
- Id string `json:"id,omitempty"`
65
- Status PaymentStatus `json:"status,omitempty"`
66
- PaymentId string `json:"payment_id,omitempty"`
67
- Amount int `json:"amount,omitempty"`
68
- Currency common.Currency `json:"currency,omitempty"`
69
- Reference string `json:"reference,omitempty"`
70
- Description string `json:"description,omitempty"`
71
- Customer * common.CustomerRequest `json:"customer,omitempty"`
72
- Billing * payments.BillingInformation `json:"billing,omitempty"`
73
- Products []payments.Product `json:"products,omitempty"`
74
- Metadata map [string ]interface {} `json:"metadata,omitempty"`
75
- SuccessUrl string `json:"success_url,omitempty"`
76
- CancelUrl string `json:"cancel_url,omitempty"`
77
- FailureUrl string `json:"failure_url,omitempty"`
78
- Links map [string ]common.Link `json:"_links"`
79
- //Not available on previous
80
- AmountAllocations []common.AmountAllocations `json:"amount_allocations,omitempty"`
68
+ HttpMetadata common.HttpMetadata
69
+ Id string `json:"id,omitempty"`
70
+ Status PaymentStatus `json:"status,omitempty"`
71
+ Amount int `json:"amount,omitempty"`
72
+ Currency common.Currency `json:"currency,omitempty"`
73
+ Billing * payments.BillingInformation `json:"billing,omitempty"`
74
+ SuccessUrl string `json:"success_url,omitempty"`
75
+ CancelUrl string `json:"cancel_url,omitempty"`
76
+ FailureUrl string `json:"failure_url,omitempty"`
77
+ PaymentId string `json:"payment_id,omitempty"`
78
+ Reference string `json:"reference,omitempty"`
79
+ Description string `json:"description,omitempty"`
80
+ Customer * common.CustomerResponse `json:"customer,omitempty"`
81
+ Products []payments.Product `json:"products,omitempty"`
82
+ Metadata map [string ]interface {} `json:"metadata,omitempty"`
83
+ AmountAllocations []common.AmountAllocations `json:"amount_allocations,omitempty"`
84
+ Links map [string ]common.Link `json:"_links"`
81
85
}
82
86
)
0 commit comments