Global API
...
Request
Transaction

Create 3D Secure Transaction

2min
note this is currently only supported for the stripe payment processor to create a transaction in the payment processor with 3ds secure authentication, please follow the below process call the "chargeprocessor" action as you normally would see here this is the normal flow for any charge if the related payment method has 3d secure authentication enabled, the response will return an authenitcation url { "authentication url" "https //hooks stripe com/ ", } the authentication url is a link to a form that will do the 3d secure authorization this needs to be loaded in an iframe hosted by you after the 3ds authentication, stripe will redirect to breadwinner to process the success or failure of the authentication after the completion of additional authentication, breadwinner will post the payment intent id to your top level page (the one hosting the iframe) window\ parent postmessage({message '3ds authentication complete', params {payment intent payment intent id}, ' '); you must extract payment intent from postmessage and then retrieve the transaction with the "fetchtransaction" global api action (example below) this will create the charge in salesforce if successful or return a 402 error if the authentication fails example of "chargeprocessor" global api action request and response for a 3ds credit card map\<string, object> chargedata = new map\<string, object>(); chargedata put('processorcustomerid', 'processorcustomerid'); chargedata put('paymentmethodid', 'paymentmethodid'); chargedata put('amount', '123 12'); chargedata put('chargecurrency', 'usd'); chargedata put('description', 'test payment'); chargedata put('paymentmethodtype', 'card'); // initializing the requestjson data to be passed map\<string, object> requestjsonmap = new map\<string, object>(); requestjsonmap put('transactions', new list\<object>{chargedata}); string reqjson = json serialize(requestjsonmap); map\<string, object> reqobj = new map\<string, object>(); reqobj put('version','1 0'); reqobj put('action','chargeprocessor'); reqobj put('processorid', 'processorid'); reqobj put('requestjson',reqjson); // placing a request to breadwinner global api map\<string,object> resp = bw payments breadwinnerpaymentsapi call(reqobj); system debug(resp); { action=chargeprocessor, version=1 0, responsejson={ "authentication url" "https //hooks stripe com/ " }, statuscode=200, timestamp=1711117871901, validrequest=true } example of "fetchtransaction" global api action request and response for authentication success and failure map\<string, object> chargedata = new map\<string, object>(); chargedata put('paymentintentid', 'paymentintentid'); // initializing the requestjson data to be passed map\<string, object> requestjsonmap = new map\<string, object>(); requestjsonmap put('transaction', new list\<object>{chargedata}); string reqjson = json serialize(requestjsonmap); map\<string, object> reqobj = new map\<string, object>(); reqobj put('version','1 0'); reqobj put('action','fetchtransaction'); reqobj put('processorid', 'processorid'); reqobj put('requestjson',reqjson); // placing a request to breadwinner global api map\<string,object> resp = bw payments breadwinnerpaymentsapi call(reqobj); system debug(resp); response for 3ds success { action=fetchtransaction, version=1 0, responsejson={ "transactions" \[ { "taxamount" null, "status" "succeeded", "staffname" null, "salesforcepaymentmethodid" "salesforcepaymentmethodid", "salesforceid" "salesforceid", "salesforcecustomerid" "salesforcecustomerid", "salesforcecontact" null, "salesforceaccount" null, "referenceid" null, "receipturl" "https //pay stripe com/receipts/payment/receipturl", "receiptnumber" null, "receiptemail" null, "processortype" "stripe", "processororgid" "processororgid", "processorid" "processorid", "processorcustomerid" "processorcustomerid", "processingfee" null, "paymentmethodtype" null, "paymentmethodid" null, "paymentintentid" null, "locationid" null, "idempotencykey" null, "errormessage" null, "description" "test payment", "createdvia" "breadwinner", "createddateinprocessor" "2024 03 21t10 32 48 000z", "chargestatus" null, "chargeistaxexempt" null, "chargecurrency" "usd", "captured" true, "billingstreetaddress2" "", "billingstreetaddress1" "", "billingpostalcode" "", "billingcountry" "in", "billingcity" "", "applicationfee" null, "amountrefunded" 0 00, "amount" 123 12 } ] }, statuscode=200, timestamp=1711022730348, validrequest=true } response for 3ds failure { action=fetchtransaction, version=1 0, responsejson={ "errors" \[ { "message" "the provided paymentmethod has failed authentication please try again or choose a different payment method ", "detail" null, "code" "402" } ] }, statuscode=200, timestamp=1711542121243, validrequest=true }