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

Ability to pass custom fields to payment request #43

Merged
merged 2 commits into from
Feb 2, 2013

Conversation

beefsack
Copy link
Contributor

@beefsack beefsack commented Feb 2, 2013

I've implemented the ability to pass custom fields to instant payment requests. Initially, I created a branch to implement the NOSHIPPING option, but after reading the API documentation (https://www.x.com/sites/default/files/pp_nvpapi_developerguide.pdf, warning, it's huge) I noticed there were about 10 fields I wanted to use but weren't implemented yet.

Having the ability to pass custom fields adhoc to the request would be more error prone, but also means this gem can support the whole API (including updates) without having to manually implement every field.

Added a :custom_fields hash to the Paypal::Payment::Request attributes. Implemented with this is replacement of lower case n in field names with the current index (lower case n is the standard for indexed values in the doc). Updated spec to test custom fields.

If you don't think this fits, please close the pull request, I'll be able to keep using this for my own stuff by referencing my repo.

Mick

…tant payments. Added conversion of lower case 'n' to the current index, as index based fields are documented with lower case 'n' in the docs. Updated spec to test custom fields.
@buildhive
Copy link

Nov Matake » paypal-express #17 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@buildhive
Copy link

Nov Matake » paypal-express #18 SUCCESS
This pull request looks good
(what's this?)

@nov
Copy link
Owner

nov commented Feb 2, 2013

Thanks for your pull request.
I'm OK for supporting custom params.

ps.
For NOSHIPPING param, you can also pass :no_shipping => true option at Paypal::Express::Request#setup.

nov added a commit that referenced this pull request Feb 2, 2013
Ability to pass custom fields to payment request
@nov nov merged commit 42131e1 into nov:master Feb 2, 2013
nov added a commit that referenced this pull request Feb 2, 2013
Use "{n}" instead of "n" for custom field indexes.
Remove "NOSHIPPING" custom field from spec. (Should we have custom field option in PayPal::Express::Request#setup too?)
ref #43
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.

3 participants