I am trying to integrate visa checkout on a site which uses paypal payment processing.
Earlier we integrated Google Wallet on our site and google wallet returned a discover card for any card selected from the google wallet and we were just passing the card details to paypal for furthur payment processing. The card response from google wallet looked something like this
"aud": "01409448849434218847",
"iat": 1424749827,
"exp": 1424753427
},
"pan": "6011988571714740",
"cvn": "827"
where pan is the discover card number and cvn is the cvv number.
But in case of visa checkout, the cvv number is not returned. A sample payment data response from visa checkout looks like this
{
"paymentRequest": {
"currencyCode": "USD",
"total": "10"
},
"userData": {
"userFirstName": "XYZ",
"userLastName": "XYZ",
"userName": "XYZ#gmail.com",
"userEmail": "XYZ#gmail.com",
"encUserId": "kFilkXPMqx9P2sxVBwZpwHZ3ZppIJSASFXOlMt/u/SU="
},
"creationTimeStamp": 1427169634910,
"paymentInstrument": {
"id": "Rjgzv/9FVVM09JiLGNHzqZlnc+h0vTA8E/NPESuZvOU=",
"lastFourDigits": "xxxx",
"binSixDigits": "xxxxxx",
"paymentType": {
"cardBrand": "VISA",
"cardType": "PREPAID"
},
"billingAddress": {
"personName": "XYZ ABC",
"line1": "131 Dartmouth St",
"city": "Boston",
"stateProvinceCode": "MA",
"postalCode": "02116",
"countryCode": "US",
"phone": "9123456789"
},
"verificationStatus": "VERIFIED",
"expired": false,
"cardArts": {
"cardArt": [
{
"baseImageFileName": "https://sandbox.secure.checkout.visa.com/VmeCardArts/uWOvgFoQISxPh_MWE7gO8xJHi_Kwti3ZgptHQ1LkSR4.png",
"height": 50,
"width": 77
}
]
},
"issuerBid": "14",
"nameOnCard": "XYZ ABC",
"expirationDate": {
"month": "01",
"year": "2018"
}
},
"shippingAddress": {
"id": "vn9XOKl/FOLHzEOrs2KoF3qA2VoFoQoaz6phbibsCVE=",
"verificationStatus": "VERIFIED",
"personName": "XYZ ABC",
"line1": "131 Dartmouth St",
"city": "Boston",
"stateProvinceCode": "MA",
"postalCode": "02116",
"countryCode": "US",
"phone": "9123456789",
"default": false
},
"riskData": {
"advice": "LOW",
"score": 0,
"avsResponseCode": "Y",
"cvvResponseCode": "M"
},
"partialShippingAddress": {
"countryCode": "US",
"postalCode": "02116"
}
}
Here we don't get the actual CVV number.
Any idea, how we can proceed with the paypal payment processing without the cvv number. (The card number comes as account number, but is not present in this response).
For security reasons, you will never receive the CVV number per Visa. You will instead receive a letter value indicating a match or not. They say that is enough to process the payment.
Related
How can I determine currencies by country? I am receiving payment transaction using Pay with Flutter plugin.
How can I make the following values in USD for America and TRY for Turkey according to the user's country.
"countryCode": "US",
"currencyCode": "USD",
const String defaultApplePay = '''{
"provider": "apple_pay",
"data": {
"merchantIdentifier": "merchant.com.sams.fish",
"displayName": "Sam's Fish",
"merchantCapabilities": ["3DS", "debit", "credit"],
"supportedNetworks": ["amex", "visa", "discover", "masterCard"],
"countryCode": "US",
"currencyCode": "USD",
"requiredBillingContactFields": ["emailAddress", "name", "phoneNumber", "postalAddress"],
"requiredShippingContactFields": [],
"shippingMethods": [
{
"amount": "0.00",
"detail": "Available within an hour",
"identifier": "in_store_pickup",
"label": "In-Store Pickup"
},
{
"amount": "4.99",
"detail": "5-8 Business Days",
"identifier": "flat_rate_shipping_id_2",
"label": "UPS Ground"
},
{
"amount": "29.99",
"detail": "1-3 Business Days",
"identifier": "flat_rate_shipping_id_1",
"label": "FedEx Priority Mail"
}
]
}
}''';
I tried to do it with the codes in the getCurrency() method above, but it adjusts according to the device language. Idont want this.
String getCurrency() {
//var format = NumberFormat.simpleCurrency(locale: Platform.localeName);
Locale myLocale = Localizations.localeOf(context);
return myLocale.countryCode ?? "";
}
I'm trying to set more than one currency code within a single order.
I sent this json to the PayPal API Create order with two currency codes, EUR and USD, distributed at random.
{
"intent": "CAPTURE",
"brand_name": "Miller-Miller",
"cancel_url": "https://adkins-knight.biz/login/",
"landing_page": "LOGIN",
"return_url": "https://kennedy.net/",
"shipping_preference": "NO_SHIPPING",
"user_action": "PAY_NOW",
"payer_email_address": "lindaholland#gmail.com",
"payer_address_line_1": "98169 Tina Ramp Apt. 548",
"payer_address_line_2": "Unions",
"payer_admin_area_1": "United States Virgin Islands",
"payer_admin_area_2": "South Veronicaborough",
"payer_country_code": "BE",
"payer_postal_code": "16858",
"payer_full_name": "Jeremy Martin Jr.",
"payer_given_name": "Sarah",
"payer_middle_name": "Richard",
"payer_prefix": "Dr.",
"payer_suffix": "DDS",
"payer_surname": "Donovan",
"user": null,
"purchase_units": [
{
"custom_id": "3cef9acd-acfd-4b57-9426-fe25b993b51f",
"description": "Process would successful not stage girl.\nEat economy air stuff wind box city. Suffer scene deal much. Rise or friend provide.",
"invoice_id": "0f2ac8bf-c763-48a2-8207-6c15a422cf44",
"reference_id": "0ea30992-6cc2-4e3f-9f9f-bb2a1ff9458d",
"soft_descriptor": "break",
"amount_currency_code": "EUR",
"amount_value": 9998008.45,
"breakdown_discount_currency_code": "EUR",
"breakdown_discount_value": 9999889.5,
"breakdown_handling_currency_code": "USD",
"breakdown_handling_value": 9999884.8,
"breakdown_insurance_currency_code": "EUR",
"breakdown_insurance_value": 9997223.61,
"breakdown_item_total_currency_code": "USD",
"breakdown_item_total_value": 9994971.56,
"breakdown_shipping_currency_code": "USD",
"breakdown_shipping_value": 9991250.62,
"breakdown_shipping_discount_currency_code": "USD",
"breakdown_shipping_discount_value": 9997344.57,
"breakdown_tax_total_currency_code": "USD",
"breakdown_tax_total_value": 9999229.59,
"shipping_type": "SHIPPING",
"shipping_address_line_1": "2359 Greene Path Suite 645",
"shipping_address_line_2": "Springs",
"shipping_admin_area_1": "Hong Kong",
"shipping_admin_area_2": "South Debra",
"shipping_country_code": "CU",
"shipping_postal_code": "95591",
"shipping_full_name": "Ashley Stone",
"items": [
{
"category": "PHYSICAL_GOODS",
"description": "Despite should allow. Military determine up she goal.",
"name": "Mary Harper",
"quantity": 4405,
"sku": "total",
"tax_currency_code": "USD",
"tax_value": 9997113.36,
"unit_amount_currency_code": "USD",
"unit_amount_value": 9998795.33
},
{
"category": "PHYSICAL_GOODS",
"description": "Hospital cover job rest new. Only citizen I generation raise present. Majority president stuff west.",
"name": "Lucas Parker",
"quantity": 1759,
"sku": "little",
"tax_currency_code": "USD",
"tax_value": 9996456.8,
"unit_amount_currency_code": "USD",
"unit_amount_value": 9999554.88
}
]
}
]
}
I got this response:
{
"name": "UNPROCESSABLE_ENTITY",
"details": [
{
"issue": "MULTI_CURRENCY_ORDER",
"description": "Multiple differing values of currency_code are not supported. Entire Order request must have the same currency_code."
}
],
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "527aca32094a2",
"links": [
{
"href": "https://developer.paypal.com/docs/api/orders/v2/#error-MULTI_CURRENCY_ORDER",
"rel": "information_link",
"method": "GET"
}
]
}
I have searched through the PayPal documentation and on Google, but it is not clear if it is possible to set up two or more currencies in a single order.
The inserted curriences (EUR & USD) are both approved in my PayPal settings following these steps from PayPal FAQ:
EDIT:
If I need to set multiple products with two curriences in a single transaction, I cannot do it? Have I do separate the order in two order, apply a single currency code for each of them?
Multiple differing values of currency_code are not supported. Entire Order request must have the same currency_code.
I am posting the following to the Shopify API create order endpoint and receiving a response without tax lines that are filled. I haven't seen anything on the internet on this, other than that Shopify doesn't offer another endpoint for just taxes. So, I am trying to figure out if tax lines are supposed to be generated automatically in the order response when creating an order via the API or if I have to include the tax lines in the request in order for tax lines to be included, because I know when I create an order in the admin the tax lines are automatically calculated and included for me?:
{
"order": {
"email": "some#email.com",
"financial_status": "paid",
"fulfillment_status": null,
"send_receipt": true,
"send_fulfillment_receipt": true,
"note": "Created by somename",
"line_items": [
{
"variant_id": 21718275463,
"quantity": 1,
"price": 99,
"requires_shipping": true,
"product_id": 6820646151
},
{
"variant_id": 21717700871,
"quantity": 1,
"price": 1000,
"requires_shipping": true,
"product_id": 6820646151
},
{
"variant_id": 21717690055,
"quantity": 1,
"price": 555,
"requires_shipping": true,
"product_id": 6821668807
}
],
"processing_method": "offsite",
"shipping_address": {
"first_name": "Chris",
"address1": "10101 Musick Road",
"phone": "9999999999",
"city": "St. Louis",
"zip": "63123",
"province": "MO",
"country": "United States",
"last_name": "Becker",
"name": "Chris Becker",
"country_code": "US",
"province_code": "MO"
},
"source_name": "somename",
"taxes_included": false,
"shipping_lines": [
{
"title": "standard",
"price": 0.00,
"code": null,
"source": "brand owner on shopify",
"carrier_identifier": null,
"tax_lines": null
}
],
"tags": "some Order"
}
}
Here is a useful documentation about tax: https://help.shopify.com/api/reference/location
Tax are not automatically calculated from cart.js ajax api. They just give a clue whether tax is already included in the price or not. If not, then it can be added with the bill.
I am trying to set up Billing Agreements using PayPal REST API with paypal-rest-api-sdk for Java on PayPal Sandbox. So, far I've been able to create a billing plan and pass it's id to create a Billing Agreement. However, the response that I get after creating a Billing Agreement does not have approval_url and redirect_url. The following is my request
{
"name": "MYOP Recurring Contribution Agreement",
"description": "Agreement for MYOP Recurring Contributions",
"start_date": "2014-12-13T06:26:32Z",
"payer": {
"payment_method": "credit_card",
"funding_instruments": [
{
"credit_card": {
"number": "XXXXXXXXXXXX",
"type": "visa",
"expire_month": 1,
"expire_year": 2015,
"cvv2": 874,
"first_name": "Joe",
"last_name": "Young",
"billing_address": {
"line1": "52 N Main ST",
"city": "Johnstown",
"country_code": "US",
"postal_code": "43210",
"state": "OH"
}
}
}
]
},
"plan": {
"id": "P-85A16162MC374104FU7KAYMQ"
}
}
As a response to my create Billing Agreement request, I receive only the following:
{
"id": "I-77GK9WNNV04U",
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-77GK9WNNV04U",
"rel": "self",
"method": "GET"
}
]
}
When I fetch the created Billing Agreement with a GET request on the agreement id, I receive information about the agreement that has a 'links' array that does not contain approval_url or redirect_url.
I am unable to proceed to send the payer to an approval url to then execute the agreement. Help please.
You are using ("payment_method":"credit_card") Change the ("Payment_method":"PAYPAL")
'{
"name": "T-Shirt of the Month Club Plan",
"description": "Template creation.",
"start_date": "2016-03-31T00:37:04Z",
"plan": {
"id":"'.$plan_id.'"
},
"payer": {
"payment_method": "PAYPAL"
},
"shipping_address": {
"line1": "111 First Street",
"city": "Saratoga",
"state": "CA",
"postal_code": "95070",
"country_code": "US"
}
}';
Thanks
The approval and the redirect url is only applicable when you make the PayPal Payments so that the buyers can login to their PayPal account and approve the transaction .
Since you are making the billing agreement on credit card , the recurring profile will be created right away and need not go thru any redirect url .
Is it possible to process a credit card transaction without using the line 1, city, and state values in the credit_card.billing_address object?
"funding_instruments": [
{
"credit_card": {
"type": "visa",
"number": "xxxxxxxxxxxx0331",
"expire_month": "11",
"expire_year": "2018",
"first_name": "Joe",
"last_name": "Shopper",
"billing_address": {
"line1": "52 N Main ST",
"city": "Johnstown",
"state": "OH",
"postal_code": "43210",
"country_code": "US"
}
}
}
]
The REST API seems to require the billing address. If you use the Payments Pro / PayFlow API, though, you can adjust the AVS and CVV2 settings in your Fraud Filters so you could then process credit cards without an address.