forked from checkout/checkout-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
links.go
83 lines (75 loc) · 4.15 KB
/
links.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package links
import (
"time"
"github.com/PaddleHQ/checkout-sdk-go/common"
"github.com/PaddleHQ/checkout-sdk-go/payments"
)
const PaymentLinksPath = "payment-links"
type PaymentStatus string
const (
Active PaymentStatus = "Active"
PaymentReceived PaymentStatus = "Payment Received"
Expired PaymentStatus = "Expired"
)
type (
PaymentLinkRequest struct {
Amount int `json:"amount,omitempty"`
Currency common.Currency `json:"currency,omitempty"`
PaymentType payments.PaymentType `json:"payment_type,omitempty,omitempty"`
PaymentIp string `json:"payment_ip,omitempty"`
BillingDescriptor *payments.BillingDescriptor `json:"billing_descriptor,omitempty"`
Reference string `json:"reference,omitempty"`
Description string `json:"description,omitempty"`
ExpiresIn int `json:"expires_in,omitempty"`
Customer *common.CustomerRequest `json:"customer,omitempty"`
Shipping *payments.ShippingDetails `json:"shipping,omitempty"`
Billing *payments.BillingInformation `json:"billing,omitempty"`
Recipient *payments.PaymentRecipient `json:"recipient,omitempty"`
Processing *payments.ProcessingSettings `json:"processing,omitempty"`
AllowPaymentMethods []payments.SourceType `json:"allow_payment_methods,omitempty"`
Products []payments.Product `json:"products,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
ThreeDs *payments.ThreeDsRequest `json:"3ds,omitempty"`
Risk *payments.RiskRequest `json:"risk,omitempty"`
ReturnUrl string `json:"return_url,omitempty"`
Locale string `json:"locale,omitempty"`
Capture bool `json:"capture,omitempty"`
CaptureOn *time.Time `json:"capture_on,omitempty"`
//Not available on previous
ProcessingChannelId string `json:"processing_channel_id,omitempty"`
AmountAllocations []common.AmountAllocations `json:"amount_allocations,omitempty"`
}
)
type (
PaymentLinkResponse struct {
HttpMetadata common.HttpMetadata
Id string `json:"id,omitempty"`
ExpiresOn string `json:"expires_on,omitempty"`
Reference string `json:"reference,omitempty"`
Warnings []interface{} `json:"warnings,omitempty"`
Links map[string]common.Link `json:"_links"`
}
PaymentLinkDetails struct {
HttpMetadata common.HttpMetadata
Id string `json:"id,omitempty"`
Status PaymentStatus `json:"status,omitempty"`
PaymentId string `json:"payment_id,omitempty"`
Amount int `json:"amount,omitempty"`
Currency common.Currency `json:"currency,omitempty"`
Reference string `json:"reference,omitempty"`
Description string `json:"description,omitempty"`
CreatedOn string `json:"created_on,omitempty"`
ExpiresOn string `json:"expires_on,omitempty"`
Customer *common.CustomerRequest `json:"customer,omitempty"`
Shipping *payments.ShippingDetails `json:"shipping,omitempty"`
Billing *payments.BillingInformation `json:"billing,omitempty"`
Products []payments.Product `json:"products,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
Locale string `json:"locale,omitempty"`
ReturnUrl string `json:"return_url,omitempty"`
Links map[string]common.Link `json:"_links"`
//Not available on previous
ProcessingChannelId string `json:"processing_channel_id,omitempty"`
AmountAllocations []common.AmountAllocations `json:"amount_allocations,omitempty"`
}
)