Created
November 17, 2011 03:34
-
-
Save sivabudh/1372301 to your computer and use it in GitHub Desktop.
PaypalExpressHelper#get_order_info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module PaypalExpressHelper | |
def get_setup_purchase_params(cart, request) | |
# implemented in the previous blog post | |
end | |
def get_order_info(gateway_response, cart) | |
subtotal, shipping, total = get_totals(cart) | |
{ | |
shipping_address: gateway_response.address, | |
email: gateway_response.email, | |
name: gateway_response.name, | |
gateway_details: { | |
:token => gateway_response.token, | |
:payer_id => gateway_response.payer_id, | |
}, | |
subtotal: subtotal, | |
shipping: shipping, | |
total: total, | |
} | |
end | |
def get_shipping(cart) | |
# define your own shipping calculation rules here | |
end | |
def get_items(cart) | |
# implemented in the previous blog post | |
end | |
def get_totals(cart) | |
# implemented in the previous blog post | |
end | |
def to_cents(money) | |
# implemented in the previous blog post | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment