Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to implement a Charge Authorization for a Recurring Payments scenario #15

Open
booktrakker opened this issue Apr 13, 2023 · 1 comment

Comments

@booktrakker
Copy link

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;

@debbie-martindale-amz
Copy link

Hello @booktrakker you can reference this guide to assist with creating authorizations for recurring Charge Permission: https://developer.amazon.com/docs/amazon-pay-recurring-checkout/manage-recurring-payments.html

Thanks for reporting the incorrect data type used in the sample code. This should be the sample for GetChargePermisson:
`

    // check if API call was successful
    if (!result.Success)
    {
        // handle the API error (use Status field to get the numeric error code)
    }

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

    // ...
}

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants