Sublytics API for Apple/Google Pay

First add a Apple/Google Pay Supported Merchant ( Stripe / Braintree ) inside of Sublytics and add Apple/Google Pay as an available payment method. Using the SDK available from the merchant website, the response returned will look similar to the following.

 

The following example will use Apple Pay (payment_method_id=4), when using Google Pay, use payment_method_id=3

{ "id": "tok_1GNWd5DCBweCXXA2324SSSS", "object": "token", "card": { "id": "card_XXXXXXXXXXXX", "object": "card", "address_city": "city", "address_country": "US", "address_line1": "test", "address_line1_check": "unchecked", "address_line2": "", "address_state": "CA", "address_zip": "12345", "address_zip_check": "unchecked", "brand": "MasterCard", "country": "US", "cvc_check": null, "dynamic_last4": "1234", "exp_month": 4, "exp_year": 2023, "funding": "credit", "last4": "1234", "metadata": {}, "name": "Test test", "tokenization_method": "apple_pay" }, "client_ip": "1.1.1.1", "created": 1584417731, "livemode": false, "type": "card", "used": false }

 

You can then pass the ID value from the SDK used in the api call (order/doProcess, order/doAddProcess ) to Sublytics under the payment_token value. It is recommended to pass the merchant_id associated with the Apple/Google Pay SDK used.

 

## doAddProcess Request curl -X "POST" "https://{your_sublytics_domain}/api/order/doAddProcess" \ -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \ --data-urlencode "user_id=XXXXX" \ --data-urlencode "user_password=XXXXX" \ --data-urlencode "email=customer@testorder.com" \ --data-urlencode "phone=1114000880" \ --data-urlencode "bill_fname=Test" \ --data-urlencode "bill_lname=User" \ --data-urlencode "bill_country=US" \ --data-urlencode "bill_address1=123 test Order" \ --data-urlencode "bill_address2=" \ --data-urlencode "bill_city=Test" \ --data-urlencode "bill_state=CO" \ --data-urlencode "bill_zipcode=18966" \ --data-urlencode "shipping_same=1" \ --data-urlencode "offers=[{\"offer_id\":89, \"order_offer_quantity\": 1,\"order_offer_price\":34.99}]" \ --data-urlencode "payment_method_id=4" \ --data-urlencode "payment_token=tok_1GNWd5DCBweCXXA2324SSSS" \ --data-urlencode "merchant_id=1" \ --data-urlencode "campaign_id=2" \ --data-urlencode "connection_id=1"

 
 
 
 
Was this article helpful?
0 out of 0 found this helpful