I'm trying to integrate Amazon Payments (Payment only, not login with Amazon) into my site.
I can successfully display the authentication form for the payment:
<div id="AmazonPayButton" />
@{
var callbackurl = string.Format("{0}://{1}/Account/AmazonConfirm", Request.Url.Scheme, Request.Url.Authority);
}
<script type="text/javascript">
OffAmazonPayments.Button("AmazonPayButton", "M_MYSELLERID_1234567", {
type: "PwA",
size: "medium",
authorization: function() {
loginOptions =
{scope: "payments:widget", popup: true };
authRequest = amazon.Login.authorize(loginOptions, "@(callbackurl)");
},
onError: function(error) {
alert('We could not connect to Amazon to process your payment, try again later');
}
});
</script>
</div>
Amazon successful redirects to my callback URL after authentication. But when I try to display the wallet widget with the Same Seller ID, I get an "invalid seller ID" error:
<div id="walletWidgetDiv">
</div>
<script>
new OffAmazonPayments.Widgets.Wallet({
sellerId: 'M_MYSELLERID_1234567',
onReady: function(billingAgreement) {
var billingAgreementId = billingAgreement.getAmazonBillingAgreementId();
},
agreementType: 'BillingAgreement',
design: {
size : {width:'400px', height:'260px'}
},
onPaymentSelect: function(billingAgreement) {
// Replace this code with the action that you want to perform
// after the payment method is selected.
},
onError: function(error) {
alert(error.getErrorMessage());
}
}).bind("walletWidgetDiv");
</script>
Why would the authentication work, only to have the Wallet display rejected?
Update @Brent Douglas in his answer triggered me to recheck my seller ID and I had specified an incorrect ID in one of my script references. Now I get the following error:
"the seller ID is not in the appropriate state to execute the request"
Not sure what that means. I checked my account and the deposit/banking info is specified, and nothing else is flagged on the Integration Settings page. Is there anything else in the account that needs to be added/verified? (Other than the typical, web page URL and other info)