question

shaqspeare avatar image
shaqspeare asked

How do I get AmazonOrderReferenceId?

[On behalf of: Wholesale Solar...] I have added the pay with amazon button to my site. Once clicked the user is redirected to another page where the address book and wallet widgets are displayed (they are displaying with my test account information so I believe I have gotten this far correctly) The question is WHATS NEXT? How do I get an AmazonOrderReferenceId? I have been reading the documentation for days now and I am still pulling my hair out! It seems like I need this OrderReferenceId to do anything from here on out. Even while in the scratchpad I need to fill in that information. I downloaded the PHP SDK and tried running through some of the samples, I filled out all of the proper information but when I run signin.php I get a page full of errors that dont make sense because I have all of the values in the MerchantValues.php file filled in and I think correctly. Maybe my XAMPP doesnt have the read/write access(idk)? (see bottom of post) Information filled out in MerchantValues.php define('***',$merchantId); define('***',$accessKey); define('***',$secretKey); define('***',$applicationName); define('2013-01-01',$applicationVersion); define("US",$region); define('SANDBOX',$environment); define(' https://mws.amazonservices.com/OffAmazonPayments_Sandbox/2013-01-01/', $serviceUrl); define(' https://static-na.payments-amazon.com/OffAmazonPayments/us/sandbox/js/Widgets.js', $widgetUrl); define('CA_BUNDLEFILE', $caBundleFile); define('***', $clientId); Errors when trying to run signin.php Notice: Undefined variable: serviceUrl in /Applications/XAMPP/xamppfiles/htdocs/xampp/src/OffAmazonPaymentsService/ MerchantValues.php on line 29 Notice: Undefined variable: widgetUrl in /Applications/XAMPP/xamppfiles/htdocs/xampp/src/OffAmazonPaymentsService/ MerchantValues.php on line 30 Notice: Undefined variable: caBundleFile in /Applications/XAMPP/xamppfiles/htdocs/xampp/src/OffAmazonPaymentsService/ MerchantValues.php on line 31 Notice: Use of undefined constant MERCHANT_ID - assumed 'MERCHANT_ID' in /Applications/XAMPP/xamppfiles/htdocs/xampp/src/OffAmazonPaymentsService/ Client.php on line 115 Notice: Use of undefined constant ACCESS_KEY - assumed 'ACCESS_KEY' in /Applications/XAMPP/xamppfiles/htdocs/xampp/src/OffAmazonPaymentsService/ Client.php on line 116 Notice: Use of undefined constant SECRET_KEY - assumed 'SECRET_KEY' in /Applications/XAMPP/xamppfiles/htdocs/xampp/src/OffAmazonPaymentsService/ Client.php on line 117 Notice: Use of undefined constant APPLICATION_NAME - assumed 'APPLICATION_NAME' in /Applications/XAMPP/xamppfiles/htdocs/xampp/src/OffAmazonPaymentsService/ Client.php on line 118 Notice: Use of undefined constant APPLICATION_VERSION - assumed 'APPLICATION_VERSION' in /Applications/XAMPP/xamppfiles/htdocs/xampp/src/OffAmazonPaymentsService/ Client.php on line 119 Notice: Use of undefined constant REGION - assumed 'REGION' in /Applications/XAMPP/xamppfiles/htdocs/xampp/src/OffAmazonPaymentsService/ Client.php on line 120 Notice: Use of undefined constant ENVIRONMENT - assumed 'ENVIRONMENT' in /Applications/XAMPP/xamppfiles/htdocs/xampp/src/OffAmazonPaymentsService/ Client.php on line 121 Notice: Use of undefined constant SERVICE_URL - assumed 'SERVICE_URL' in /Applications/XAMPP/xamppfiles/htdocs/xampp/src/OffAmazonPaymentsService/ Client.php on line 122 Notice: Use of undefined constant WIDGET_URL - assumed 'WIDGET_URL' in /Applications/XAMPP/xamppfiles/htdocs/xampp/src/OffAmazonPaymentsService/ Client.php on line 123 Notice: Use of undefined constant CLIENT_ID - assumed 'CLIENT_ID' in /Applications/XAMPP/xamppfiles/htdocs/xampp/src/OffAmazonPaymentsService/ Client.php on line 126
login with amazon
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

shaqspeare avatar image
shaqspeare answered
Are you using Login and Pay with the embedded AddressBook and Wallet widgets? If so, you can retrieve the AmazonOrderReferenceId from the AddressBook via the "onOrderReferenceCreate" parameter. If you set this parameter to a function, that function will be called with a OrderReference object. You can retrieve the AmazonOrderReferenceId by calling "getAmazonOrderReferenceId()" on the OrderReference object. Please refer to the sample code in Getting Started Step 3 of the Login and Pay with Amazon Integration Guide. For your PHP errors, it looks like you have not defined those constants with the appropriate values. There should be a "ReadMe" file within the PHP SDK download. This file should explain how to set those constants and which values to set them to. If you have further payments-related questions, I recommend posting them to the Amazon Payments seller forums to receive the fastest resolution.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.