Skip to content

Commit

Permalink
Amazon Payments
Browse files Browse the repository at this point in the history
* Always redirect to shipping-and-billing view
* remove amazonOrderReferenceId from AddressBook widget
* remove onOrderReferenceCreate listener from Wallet widget.
  • Loading branch information
JustinSainton committed Jun 13, 2015
1 parent 5d1dc4d commit 2038abb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,7 @@ public function scripts() {

$is_pay_page = _wpsc_get_current_controller_name() == 'checkout' || _wpsc_get_current_controller_name() == 'cart';

$redirect = wpsc_uses_shipping() ? 'shipping-and-billing' : 'payment';

$redirect_page = $is_pay_page ? add_query_arg( 'amazon_payments_advanced', 'true', wpsc_get_checkout_url( $redirect ) ) : esc_url_raw( add_query_arg( 'amazon_payments_advanced', 'true' ) );
$redirect_page = $is_pay_page ? add_query_arg( 'amazon_payments_advanced', 'true', wpsc_get_checkout_url( 'shipping-and-billing' ) ) : esc_url_raw( add_query_arg( 'amazon_payments_advanced', 'true' ) );

wp_localize_script( 'amazon_payments_advanced', 'amazon_payments_advanced_params', array(
'seller_id' => $this->setting->get( 'seller_id' ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jQuery(function($) {
// Addressbook widget
new OffAmazonPayments.Widgets.AddressBook({
sellerId: amazon_payments_advanced_params.seller_id,
amazonOrderReferenceId: amazon_payments_advanced_params.reference_id,
onOrderReferenceCreate: function(orderReference) {
$( 'input[name="amazon_reference_id"]' ).val( orderReference.getAmazonOrderReferenceId() )
console.log( orderReference.getAmazonOrderReferenceId() );
Expand All @@ -32,10 +31,6 @@ jQuery(function($) {
// Wallet widget
new OffAmazonPayments.Widgets.Wallet({
sellerId: amazon_payments_advanced_params.seller_id,
onOrderReferenceCreate: function(orderReference) {
$( 'input[name="amazon_reference_id"]' ).val( orderReference.getAmazonOrderReferenceId() );
console.log( orderReference.getAmazonOrderReferenceId() );
},
design: {
designMode: 'responsive'
},
Expand Down

0 comments on commit 2038abb

Please sign in to comment.