--------------------------------------------------------------
Created : 12 April 2017
Last Modified : 19 Mar 2020
***********************************************************************************
Contents:
A. SUMMARY
B. FILE STRUCTURE
C. INSTALLATION INSTRUCTION
D. HOW IT WORKS
E. FILE NEED TO BE MODIFIED
F. CONFIGURATION SETTINGS
G. DATABASE TABLES MODIFIED
H. LANGUAGE SETTINGS CHANGED
I. CHANGE LOGS
J. TROUBLESHOOTING
K. COPYRIGHT NOTICE
L. TERMS AND CONDITIONS
***********************************************************************************
A. SUMMARY
==========
This interface is for use with Amazon Pay Payment Service.
It is supporting both normal checkout and onepage checkout.
***********************************************************************************
B. FILE STRUCTURE
===================
Files included in the zip are:
- $READ_ME_FIRST_amazonpay900.html
- sha256.wsc
- shopamazonpay_subs.asp
- shopamazonpay_checkout.asp
- shopamazonpay_config.asp
- shopamazonpay_execute.asp
- shopamazonpay_login.asp
- shopamazonpay_payment.asp
- admin\amazonpay_setup.asp
- admin\amazonpay_setup_config.asp
- admin\amazonpay_setup_process.asp
- admin\sqlscripts\amazonpay\*
***********************************************************************************
C. INSTALLATION INSTRUCTION
============================
1. Upload below files to VPCart root folder.
- shopamazonpay_subs.asp
- shopamazonpay_checkout.asp
- shopamazonpay_config.asp
- shopamazonpay_execute.asp
- shopamazonpay_login.asp
- shopamazonpay_payment.asp
1a. Upload below files to your ADMIN folder. If you have renamed your ADMIN folder, then this must be placed in the renamed folder.
- admin\amazonpay_setup.asp
- admin\amazonpay_setup_config.asp
- admin\amazonpay_setup_process.asp
- admin\sqlscripts\amazonpay\*
2. Please download the files below from your server via FTP and follow the instructions below to modify the files.
- shoponepagecheckout.asp
- shoponepagecheckout_payment_subs.asp
- js/checkout/onepagecheckout.js
2.1 Open the file shoponepagecheckout.asp with your favorite editor and
2.1a. Locate sub validatepaymentmethod routine, add this code below case "paypal":
case "amazonpay"
It should look like this:
Next, locate this code below inside sub gatewayaction_onepage routine:
It should look like this one:
case "paypal"
responseredirect "paypal_process.asp"
case "amazonpay"
%> <script type='text/javascript'>
window.top.location="shopamazonpay_login.asp";
</script>
<%
response.end
end select
2.1b. Save the file
2.2 Open the file shoponepagecheckout_payment_subs.asp with your favorite editor and
2.2a. Locate to last line and before %>, and insert below line:
sub create_onepage_amazonpay_wrapper (idname, passdesc, passvalue)
dim displaystr
displaystr = "style=""display:none;"""
if lcase(passvalue) <> "" then
displaystr = ""
end if
htmlwrite "<div "& displaystr &" id="""& idname &""">"
response.write passdesc
htmlwrite "</div>"
end sub
Next, inside sub display_onepage_payment_section routine, locate this code (approx line 32-35):
if lcase(GetConfig("xpaypal")) = "yes" then
create_onepage_radio getlang("langcommonpaypal"), "payment_method", "payment_method_paypal", "paypal", paypalstr
create_onepage_paypal_wrapper "paypal_desc_wrapper", getlang("langpaypalonepage_desc"), paypalstr
end if
if lcase(GetConfig("xamazonpay")) = "yes" then
create_onepage_radio getlang("langamazonpay"), "payment_method", "payment_method_amazon", "amazonpay", paypalstr
create_onepage_amazonpay_wrapper "amazonpay_desc_wrapper", getlang("langamazonpayonepage_desc"), paypalstr
end if
It should look like this:
if lcase(GetConfig("xpaypal")) = "yes" then
create_onepage_radio getlang("langcommonpaypal"), "payment_method", "payment_method_paypal", "paypal", paypalstr
create_onepage_paypal_wrapper "paypal_desc_wrapper", getlang("langpaypalonepage_desc"), paypalstr
end if
if lcase(GetConfig("xamazonpay")) = "yes" then
create_onepage_radio getlang("langamazonpay"), "payment_method", "payment_method_amazon", "amazonpay", paypalstr
create_onepage_amazonpay_wrapper "amazonpay_desc_wrapper", getlang("langamazonpayonepage_desc"), paypalstr
end if
2.2b. Save the file
2.2c. Open the file plugins/checkout/onepagecheckout.js with your favorite editorif ($(this).attr('id') == 'payment_method_other') {
BEFORE the code, please insert this code: if( $(this).attr('id') == 'payment_method_amazon'){
$('#otherpayment_wrapper').hide();
$('#creditcard_desc_wrapper').hide();
$('#paypal_desc_wrapper').hide();
$('#amazonpay_desc_wrapper').show();
}
2.2e. Locate this code (approx line 189):
$('#paypal_desc_wrapper').show();
Below that, please insert:
$('#amazonpay_desc_wrapper').hide();
Locate this code (Approx line 213):$('#otherpayment_wrapper').show();
BELOW that, please insert:
$('#amazonpay_desc_wrapper').hide();
Locate this code (Approx line 228):$('#creditcard_desc_wrapper').show();
BELOW that, please insert:$('#amazonpay_desc_wrapper').hide();
2.2f. Save the file
3. Upload all amended files above to your server.
4. Log into super admin and execute setup file amazonpay_setup.asp, eg: http://www.yourdomain.com/youradminfolder/amazonpay_setup.asp
Note: Replace url section with your VPCart site url values:
{ www.yourdomain.com } : your site domain
{ youradminfolder } : your admin folder
5. After setup the module, would be redirected to Module configuration page to configure the module.
NOTE:
you will need to access your amazon seller account page admin to get API keys ( https://sellercentral.amazon.com/hz/me/integration/details )
follow the steps to in order to get the api key:
1. In https://sellercentral.amazon.com/gp/homepage.html, select the Production View or Sandbox View option that on the left most field in top right corner of the page.
2. Hover on the Integration menu on the top left corner of the page. look for MWS Access Key and click.
also, you need to put your site domain as value for in Web Settings : Allowed Javascript Origin value in login with amazon (located at the top right dropdown of the amazon seller account after you logged in).
To get this done, follow these steps:
1. https://sellercentral.amazon.com/gp/homepage.html, select the Login with Amazon option that on the left most field in top right corner of the page and click.
2. Locate the Web Settings Section and click edit button.
3. Locate Allowed JavaScript Origins section and click add another option.
4. paste your root domain here. It should be in https domain value.
eg: https://yourdomain.com
5. click save button
On the checkout page (normal checkout and onepage checkout), Amazon Pay gateway will be displayed as an option if Amazon Pay is activated from Modules Manager.
Customers can now checkout and pay through their Amazon Pay account.
***********************************************************************************
E. FILE NEED TO BE MODIFIED
=================
- shoponepagecheckout.asp
- shoponepagecheckout_payment_subs.asp
- js/checkout/onpeagecheckout.js
New configs :
xamazonpay
xamazonp_merchantid
xamazonp_secretkey
xamazonp_accesskey
xamazonp_clientid
xamazonp_region
xamazonp_sandbox
NONE
ADDED:
langamazonpay
langamazonpayonepage_desc
NONE
1. Why did the module not working fail?
Please make sure you've entered the correct configuration values and put correct domain value field in your amazon seller account : login with amazon, Allowed JavaScript Origins section.
2. Amazonpay gateway still does not work !
Please submit a ticket to our helpdesk at https://helpdesk.vpcart.com and our support team will assist you.