Coder Social home page Coder Social logo

checkout-sdk-go's People

Contributors

a-ibarra avatar armando-rodriguez-cko avatar armandojaleo avatar borosr avatar cko-developer-portal[bot] avatar gomezjdaniel avatar ismabd avatar martinseco avatar mickeyreiss avatar rsaestrela avatar shiuh-yaw avatar thiyya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

checkout-sdk-go's Issues

422 Unprocessable Entity /hosted-payments

Environment

  • Checkout SDK version: v1.0.12
  • Platform and version: macos
  • Operating System and version:

Description

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)

Expected behavior

Response token

Current behavior

422 Unprocessable Entity

Steps to reproduce

Possible solution

  • I may be able to implement this bug fix

Additional information

Safe to use beta sdk in production env?

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

Installation instructions contain incorrect Github URL

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.