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

Populate payment type and serialise as string #47

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

Conversation

kz412
Copy link

@kz412 kz412 commented Nov 26, 2019

Add payment type enum to PaypalPaymentDetails, and serialise this property on both PaypalPaymentDetails and CreditCardPaymentDetails as a string, in line with api docs.

Currently the _type enum is serialised as an int, leading paymentDetails looking like this when serialised (note the value of 0 for _type):

"payment_details": [
--
{
"avs_result_code": "",
"credit_card_bin": "444433",
"credit_card_company": "Visa",
"credit_card_number": "XXXX-XXXX-XXXX-1111",
"cvv_result_code": "",
"_type": 0
}

Additionally, the _type property doesn't appear to exist on the PaypalPaymentDetails object. This PR modifies both payment detail objects to always supply the type, and serialise the type as a string, i.e:

"payment_details": [
--
{
"avs_result_code": "",
"credit_card_bin": "444433",
"credit_card_company": "Visa",
"credit_card_number": "XXXX-XXXX-XXXX-1111",
"cvv_result_code": "",
"_type": "credit_card"
}

…perty on both PaypalPaymentDetails and CreditCardPaymentDetails as a string, in line with api docs.
@kz412 kz412 force-pushed the feature/add_payment_detail_type_and_fix_serialisation branch from 4d1160a to 158d935 Compare November 26, 2019 07:06
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.

1 participant