Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subtract store credit from total sent to PayBright #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

luukveenis
Copy link
Member

@luukveenis luukveenis commented Aug 1, 2017

Since PayBright doesn't allow us to modify payments before capturing them like some other payment methods, we need to ensure we send them the correct amount right away.

Copy link
Member

@alepore alepore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never used the Store credit functionality, but i think this makes sense.
Question: What if the user spend some credits during (but outside) the paybright checkout?

@@ -15,7 +15,7 @@ def build_redirect_params
params = {
# mandatory parameters
"x_account_id" => credentials[:api_key],
"x_amount" => order.total.to_money.to_s,
"x_amount" => (order.total - order.total_applicable_store_credit).to_money.to_s,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: i see there's an Order#order_total_after_store_credit method

Since PayBright doesn't allow us to modify payments before capturing
them like some other payment methods, we need to ensure we send them the
correct amount right away.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants