Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Support customer profiles in purchase transactions #7

Closed
wants to merge 1 commit into from

2 participants

@kristinalim

This fixes failure when confirming orders with auto-capture (Spree::Config[:auto_capture]) enabled.

Kristina Lim Support customer profiles in purchase transactions
This fixes failure when confirming orders with auto-capture
(Spree::Config[:auto_capture]) enabled.
eafd1c6
@radar radar closed this pull request from a commit
Kristina Lim Support customer profiles in purchase transactions
This fixes failure when confirming orders with auto-capture
(Spree::Config[:auto_capture]) enabled.

Fixes #7
fee1602
@radar radar closed this in fee1602
@radar

Merged with @fee1602. Thank you :)

@kristinalim

No problem. :-) Thanks for your work on Spree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 19, 2012
  1. Support customer profiles in purchase transactions

    Kristina Lim authored
    This fixes failure when confirming orders with auto-capture
    (Spree::Config[:auto_capture]) enabled.
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 5 deletions.
  1. +8 −5 lib/spree_usa_epay/client.rb
View
13 lib/spree_usa_epay/client.rb
@@ -32,11 +32,14 @@ def authorize(amount, creditcard, gateway_options)
def purchase(amount, creditcard, gateway_options)
- token = security_token(gateway_options)
- request = transaction_request_object(amount, creditcard, gateway_options)
-
- response = request(:run_transaction, { "Token" => token, "Params" => request })
- billing_response response[:run_transaction_response][:run_transaction_return]
+ if creditcard.gateway_customer_profile_id?
+ run_customer_transaction('Sale', amount, creditcard, gateway_options)
+ else
+ token = security_token(gateway_options)
+ request = transaction_request_object(amount, creditcard, gateway_options)
+ response = request(:run_transaction, { "Token" => token, "Params" => request })
+ billing_response response[:run_transaction_response][:run_transaction_return]
+ end
end
def add_customer(amount, creditcard, gateway_options)
Something went wrong with that request. Please try again.