checkout / checkout-sdk-go Goto Github PK
View Code? Open in Web Editor NEWCheckout.com SDK for Go
License: MIT License
Checkout.com SDK for Go
License: MIT License
checkout-sdk-go/payments/payment.go
Line 396 in e8b4912
Hi,
Do you have any plan to support CheckoutPlatform and Transfer apis ?
try to make request
"github.com/checkout/checkout-sdk-go/common"
"github.com/checkout/checkout-sdk-go/nas"
"github.com/checkout/checkout-sdk-go/payments"
"github.com/checkout/checkout-sdk-go/payments/hosted"
api, err := checkout.Builder().
StaticKeys().
WithEnvironment(configuration.Sandbox()).
WithSecretKey(cfg.CheckoutSecretKey).
WithPublicKey(cfg.CheckoutPublicKey).
WithLogger(configuration.DefaultLogger()).
Build()
address := common.Address{
Country: common.GB,
}
request := hosted.HostedPaymentRequest{
Amount: 10,
Currency: common.GBP,
PaymentType: payments.Regular,
BillingDescriptor: &payments.BillingDescriptor{
Name: "Test",
City: "London",
},
Reference: uuid.New().String(),
Description: "Description",
Customer: &common.CustomerRequest{
Email: "[email protected]",
Name: "Name",
},
Shipping: &payments.ShippingDetails{
Address: &address,
},
Billing: &payments.BillingInformation{
Address: &address,
},
Recipient: &payments.PaymentRecipient{},
Processing: &payments.ProcessingSettings{Aft: true},
Products: []payments.Product{},
Risk: &payments.RiskRequest{Enabled: false},
SuccessUrl: "https://docs.checkout.com/payments/success",
CancelUrl: "https://docs.checkout.com/payments/cancel",
FailureUrl: "https://docs.checkout.com/payments/failure",
Locale: "en-GB",
ThreeDs: &payments.ThreeDsRequest{
Enabled: false,
AttemptN3D: false,
ChallengeIndicator: common.NoChallengeRequested,
},
Capture: true,
CaptureOn: (func() *time.Time {
time := time.Now().AddDate(0, 0, 30)
return &time
})(),
}
response, err := api.Hosted.CreateHostedPaymentsPageSession(request)
Response token
422 Unprocessable Entity
Hello team!
Good work on the SDK for golang. I see the status is beta for now. Can you guys confirm if it is safe to use in a production environment? If not, when can we expect a stable release of the golang sdk for checkout.
Thank you for your contributions
The Module Installer directions in the Readme contain the following URL for the SDK:
github.com/checkout-sdk-go@{version}
This is incorrect as it does not contain the organization name. It should be:
github.com/checkout/checkout-sdk-go@{version}
The Import code snippet should similarly be updated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.