Code Monkey home page Code Monkey logo

amazon-pay-api-sdk-dotnet's People

Contributors

akshitawaldia avatar bjguillot avatar jpeddicord avatar kendallb avatar lemked avatar xin9le avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amazon-pay-api-sdk-dotnet's Issues

ToJson serializes payload including type names

The SDK serializes the CreateCheckoutSessionRequest to something like
{"$type":"Amazon.Pay.API.WebStore.CheckoutSession.CreateCheckoutSessionRequest, Amazon.Pay.API.SDK","storeId":"amzn1.application-oa2-client.xxxxx".....

Which leads to an API error:
Session ID: 261-4620331-2863352
Error Code: UnrecognizedField
Error Message: The field '$type' is invalid for this API.

Probably TypeNameHandling = TypeNameHandling.None has to be added here.

I am using Newtonsoft.Json version 13.0.1.

Trying to implement a Charge Authorization for a Recurring Payments scenario

Hello,

I am migrating an application I wrote about 10 years ago to the current version of Amazon Pay. I am using this SDK, and I have the Payment Registration completed. I am now trying to implement the Recurring Payment Authorizations.

I have two current issues. First, it is not clear how to implement the Recurring Payment Authorizations. The old system had an IPNHandler that was called, it is not clear how this relates to the SDK implmentation.

Can you provide a complete example of how to implement a Recurring Payment including a means by which my code can obtain whatever data is required at my end to record the transaction? This was previously handled by the IPNHandler, and it is not clear that this model remains relevant. I need to understand how to issue a Charge Authorization each month.

Second, I am getting some errors when trying to use the code examples shown here. When I try to implement the Get ChargePermission example I am running into errors for these lines - State is throwing a "Cannot declare static variable of type 'State'". I am not clear on how to resolve this.

// do something with the result, for instance: State chargePermissionState = result.StatusDetails.State; DateTime chargePermissionExpiryDate = result.ExpirationTimestamp; Address buyerAddress = result.BillingAddress;

An exception is occured when calling the UpdateChargePermission API

Reproduction steps

  1. Make a WebStore payment using Amazon Pay (v1).
  2. Use WebStoreClient.UpdateChargePermission API in the Amazon Pay (v2).

Actual behavior

The SDK fails to parse the response, because of TransactionAmountExceeded isn't defined.

Error converting value "TransactionAmountExceeded" to type 'Amazon.Pay.API.Types.ReasonCode'.
Path 'statusDetails.reasons[0].reasonCode', line 1, position 867.

Expected behavior

The response should be able to be parsed with no exceptions.

Async Tasks

Hello! Are there any plans to support C# async tasks for the methods that perform communication over the internet?
I see the README.md mentions, for example:

"This sample uses an ASP.NET Core Razor Page"

That version of ASP.NET is designed with async tasks. Will the Amazon Pay SDK likewise support async tasks sometime in future?

Ideally each async method would also include a CancellationToken parameter if possible.

Async tasks would be great to have, although in my opinion I'd rank it as a lower priority than supporting recurring payments/subscriptions, and also lower priority than supporting the new .NET 5.0 in both the old and new SDK's.

Sign-in button produces InvalidSignatureError

Using SDK v.2.5.0. While the checkout button with createCheckoutSessionConfig works fine with algorithm: 'AMZN-PAY-RSASSA-PSS-V2'. , the sign-in button

amazon.Pay.renderButton('#amazonpay-signin-button', {
	merchantId: '...',
	publicKeyId: '...',
	ledgerCurrency: 'EUR',
	checkoutLanguage: '...',
	productType: 'SignIn',
	placement: 'Other',
	buttonColor: 'Gold',
	sandbox: @(Model.UseSandbox.ToString().ToLower()),
	signInConfig: {
		payloadJSON: '...',
		signature: '...',
		publicKeyId: '...',
		algorithm: 'AMZN-PAY-RSASSA-PSS-V2'
	}
});

returns the following error:

Session ID: 257-8786629-7728010
Error Code: InvalidSignatureError
Error Message: Signature bmpfdVS7P2BTifpTTh8Gox2PrBzBGiEPXchoKMezTM0NqSBfuM6yyxnEvSOjMQnKdQ8jVBF3jKu6QfgKv5Swuif7MoNn95lfJTVfpoHK9yjUApzCvtlUxZuvsU6bt4IdOJC1/PrAu07+tcyhVXbbPMzmoLzqcUy1aLqqCkI52reesyWaI1k6N2a6AX1dR/J2JFAri//CMLndKbwFltV/T6bCV8ZoU5rOHbGNDmGr/+tVZx0o2SCp9tjJilNk65Z7ZUVjxEL7epUl/2rpXa1dT+9q+Y32yjQz3IyOFc1wcuFc/hCSD8oKT/zTqRyut2MNsmXszdGQwsvW3BjP0xUHHg==
does not match signedString AMZN-PAY-RSASSA-PSS 4b74024c202a8545e80cdf1e5bc4d602cb8f367dc6b48c2fb07bfc854a743a1a for merchant A3OJ83WFYM72IY 

Install-Package amazon-pay-api-sdk-dotnet not working

I'm trying AmazonPay v2.
But nuget install from Package Manager Console on VS failed.

I tried nuget install referring to following

I guess amazon-pay-api-sdk-dotnet doesn't exist.

PM> Install-Package amazon-pay-api-sdk-dotnet -Version 1.0.0

Restoring packages for C:\Users\nabehiro\dev\amazon-pay-sample-v2\AmazonPaySample\AmazonPaySample\AmazonPaySample.csproj...
  GET https://api.nuget.org/v3-flatcontainer/amazon-pay-api-sdk-dotnet/index.json
  NotFound https://api.nuget.org/v3-flatcontainer/amazon-pay-api-sdk-dotnet/index.json 567ms
Install-Package : NU1101: Unable to find package amazon-pay-api-sdk-dotnet. No packages exist with this id in source(s): Microsoft Visual Studio Offline 
Packages, nuget.org
At line:1 char:1
+ Install-Package amazon-pay-api-sdk-dotnet -Version 1.0.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
 
Install-Package : Package restore failed. Rolling back package changes for 'AmazonPaySample'.
At line:1 char:1
+ Install-Package amazon-pay-api-sdk-dotnet -Version 1.0.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
 

Is correct nuget package AmazonPayV2 ?

https://www.nuget.org/packages/AmazonPayV2/4.2.1.1

Your message to [email protected] couldn't be delivered.

Original Message Details

Created Date: 10/8/2019 11:45:35 PM Sender Address: [email protected] Recipient Address: [email protected] Subject: amazon pay sdk v2 Public and Private Keys | Created Date: | 10/8/2019 11:45:35 PM | Sender Address: | [email protected] | Recipient Address: | [email protected] | Subject: | amazon pay sdk v2 Public and Private Keys
Created Date: | 10/8/2019 11:45:35 PM
Sender Address: | [email protected]
Recipient Address: | [email protected]
Subject: | amazon pay sdk v2 Public and Private Keys
Error Details
Reported error: 550 5.0.350 Remote server returned an error -> 550 #5.1.0 Address rejected. DSN generated by: HK2PR04MB3889.apcprd04.prod.outlook.com Remote server: stmp-fw-0102.amazon.com | Reported error: | 550 5.0.350 Remote server returned an error -> 550 #5.1.0 Address rejected. | DSN generated by: | HK2PR04MB3889.apcprd04.prod.outlook.com | Remote server: | stmp-fw-0102.amazon.com
Reported error: | 550 5.0.350 Remote server returned an error -> 550 #5.1.0 Address rejected.
DSN generated by: | HK2PR04MB3889.apcprd04.prod.outlook.com
Remote server: | stmp-fw-0102.amazon.com

.net core 3.1 InvalidRequestSignature

Hi,

we encountered a problem with your Nuget Package when we update our shop to .net core 3.1.

We get the following response from the API when we call webStoreClient.CreateCheckoutSession:

{
   "reasonCode":"InvalidRequestSignature",
   "message":"Unable to verify signature, signing String [AMZN-PAY-RSASSA-PSS\n541....] , signature [Rc1E....]"
}

In .net core 2.0 and .net framework 4.6.2 (with your old Nuget Package https://www.nuget.org/packages/AmazonPayV2) the requests work fine with the same Private Key and Settings.

For our Testing we use the Sandbox mode.

Invalid Parameter when using checkout flow

I don't know if this should be a reported bug in the library or in AmazonPay.

When using this flow type:
https://amazonpaycheckoutintegrationguide.s3.amazonaws.com/amazon-pay-apb-checkout/additional-payment-button-overview.html

AmazonPay requires that checkOutReviewReturnUrl is NULL, and that CheckoutResultReturnUrl gets set. e.g.

var createRequest = new CreateCheckoutSessionRequest(null, GltSettings.AmazonStoreId);
createRequest.WebCheckoutDetails.CheckoutResultReturnUrl = "myreturnurl";
createRequest.WebCheckoutDetails.CheckoutMode = CheckoutMode.ProcessOrder;
createRequest.PaymentDetails.PaymentIntent = PaymentIntent.AuthorizeWithCapture;

If you set checkOutReviewReturnUrl, AmazonPay will come back with an obscure message that you have an invalid parameter. Perhaps update your docs with this info.

Also see S.O. report:
https://stackoverflow.com/questions/65535379/amazon-pay-sdk-completecheckoutsession-error/65540391?noredirect=1#comment115924981_65540391

Unavailable Report _GET_FLAT_FILE_OFFAMAZONPAYMENTS_CAPTURE_DATA_

Hello,

in the documentation i found that GET_FLAT_FILE_OFFAMAZONPAYMENTS_CAPTURE_DATA is atm not available in this API.
Is there any equivalent to this report or some different api call with the same result? (get all payments done in a specific time range, including buyer, orderreference id, amount and so on)

br

Recurring payments (subscriptions)

Congrats on the progress with API/Checkout V2! I can see that the team has made some great improvements over the previous SDK. While looking through API/Checkout V2, I find myself thinking "Nice", and "Oh yeah that's nice", and "Nice again". In contrast, with the previous SDK + Web API + integration guides... well... they're also good but unfortunately there were multiple "What the?!" moments. Happily those issues are improved in the new V2.

However, although I'm burning to use the great improvements in V2, sadly I can't use it at all because V2 does not yet support recurring payments/subscriptions, right?

Is there any rough estimate on when V2 will support recurring payments? I'd love to start using V2.

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.