Paypal - Ref Transaction Spec
Please find new changes in term of configuration & tech to implement Paypal Ref Transaction here:
1. CRM Setup:
https://www.tryemanagecrm.com/#/campaigns/settings/4825
You need to pay attention to below information when setup a campaign which work with sales model.
Sales Type: Continuity
Sales Model: Below sales model allow us to bill user twice. 1st time we bill Discounted Price ($9 per unit). 2nd time (after 15 days), we will full price with shipping fee.
Pre-order (product): https://www.tryemanagecrm.com/#/sales-models/42
Pre-order (package): https://www.tryemanagecrm.com/#/sales-models/43
Payment Provider: have PayPalRefTrans (processorID 31) for paypal checkout
Sample Page: https://www.thegadgetreviewguy.com/en/order-res-pp.html?isCardTest=1
2. Endpoint:
Create Order - POST:
URL: https://sales-prod.tryemanagecrm.com/api/orders/d19cc1ac-4ebe-4007-b22e-575869a56f77?behaviorId=2
Payload Data:
{ "couponCode": null, "shippingMethodId": 565, "comment": "", "useShippingAddressForBilling": true, "productId": 767, "customer": { "email": null, "phoneNumber": null, "firstName": null, "lastName": null }, "payment": { "paymentProcessorId": 31 }, "billingAddress": null, "analyticsV2": { "referringUrl": "", "landingUrl": "https://test.thegadgetreviewguy.com/en/order-res-test.html?iscardtest=1&sub1=123&sub2=321&afid=123", "userStringData64": "U29mdHdhcmVWZXJzaW9uPTAuMS4xMSZGaW5nZXJwcmludD00MDE1NjUzMjM1JlVzZXJBZ2VudExvd2VyQ2FzZT1tb3ppbGxhJTJGNS4wJTIwKHdpbmRvd3MlMjBudCUyMDEwLjAlM0IlMjB3aW42NCUzQiUyMHg2NCklMjBhcHBsZXdlYmtpdCUyRjUzNy4zNiUyMChraHRtbCUyQyUyMGxpa2UlMjBnZWNrbyklMjBjaHJvbWUlMkY4MC4wLjM5ODcuMTAwJTIwc2FmYXJpJTJGNTM3LjM2JkJyb3dzZXI9Q2hyb21lJkJyb3dzZXJWZXJzaW9uPTgwLjAuMzk4Ny4xMDAmRW5naW5lPVdlYktpdCZPUz1XaW5kb3dzJk9TVmVyc2lvbj0xMCZEZXZpY2U9biUyRmEmRGV2aWN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WdvZSUyMFVJJTIwU2VtaWJvbGQlMkMlMjBTZWdvZSUyMFVJJTIwU3ltYm9sJTJDJTIwU2Vnb2UlMjBVSSUyQyUyMFNob3djYXJkJTIwR290aGljJTJDJTIwU2ltU3VuJTJDJTIwU2ltU3VuLUV4dEIlMkMlMjBTbmFwJTIwSVRDJTJDJTIwU3lsZmFlbiUyQyUyMFN5bWJvbCUyQyUyMFRhaG9tYSUyQyUyMFRpbWVzJTIwTmV3JTIwUm9tYW4lMkMlMjBUcmVidWNoZXQlMjBNUyUyQyUyMFZlcmRhbmElMkMlMjBWbGFkaW1pciUyMFNjcmlwdCUyQyUyMFdlYmRpbmdzJTJDJTIwV2lkZSUyMExhdGluJTJDJTIwV2luZ2RpbmdzJmlzTG9jYWxTdG9yYWdlPXRydWUmaXNTZXNzaW9uU3RvcmFnZT10cnVlJmlzQ29va2llPXRydWUmVGltZVpvbmU9SW5kb2NoaW5hJTIwVGltZSZMYW5ndWFnZT1lbi1VUyZTeXN0ZW1MYW5ndWFnZT1uJTJGYSZpc0NhbnZhcz10cnVlJkN1c3RvbUZpbmdlcnByaW50PTE1NjIyODQwOTE=" }, "funnelBoxId": 0, "antiFraud": { "sessionId": "0f8c2942dd8847898d153ff19dd31755" }, "fingerPrintId": "52c5d37931f4a4ffc93c67397db576b4" }
Note: "paymentProcessorId": 31
Confirm Order - PUT:
Payload Data:
{ "PaymentProcessorId": "31" }
Note:
TrackingNumber is returned data from create order
Create Upsell - POST:
URL: https://sales-prod.tryemanagecrm.com/api/orders/f66ffc04-0c9a-4765-a4b9-27283879132d?behaviorId=2
Payload Data:
{ "campaignUpsell": { "webKey": "f66ffc04-0c9a-4765-a4b9-27283879132d", "relatedOrderNumber": "83725226" }, "shippingMethodId": 517, "comment": "", "useShippingAddressForBilling": true, "productId": 1159, "customer": { "email": null }, "payment": { "paymentProcessorId": 31, "callBackParam": "?&isCardTest=1&up_amp-split-v1=1" }, "shippingAddress": null, "funnelBoxId": 0, "antiFraud": { "sessionId": "973c5993c9ae4e66a14f3c5050859075" } }
Note: "paymentProcessorId": 31,
3. Feature Changes:
Order Page:
Change
paymenttype
to paypal31 (Just make it difference “paypal”)Set flag order page is Pre-Order type after product list is called from API (used for confirm page): preOrder in localStorage
Success Page:
Check if paymentProcessorId 31 then set
trackingNumber
by parameter named token
Upsell Page:
Set paymentProcessorId value is dynamic: 5 or 31. This value get from localstorage saved from order page.
Confirm Page:
Check if user checkout from Pre-Order page (preOrder in localStorage) => Update the Text.
Text changes:
ITEMS PRE-ORDERED
Your deposit will be processed for {productTotal} ({orderNumber}) and will appear as {midDescriptor}. You will be charged the price of the products when they ship.
Check if paymentProcessorId is 31 then don’t run API update status for Upsell
JS file: https://d16hdrba6dusey.cloudfront.net/sitecommon/js/pages/confirm.page.js