Initializing a single payment request
To initiate a single payment, make a call to the Web ServiceCharge/CreatePayment.
POSThttps://api.secure.osb.pf/api-payment/V4/Charge/CreatePayment
- Use the fields below to build your request:
Field name Description Required formAction Type of desired behavior when a transaction is being created. Must be set to PAYMENT.
No amount Amount due, expressed in the smallest currency unit. Yes currency Payment currency. ISO 4217 alpha-3 code. E.g.: “XPF” for CFP francs. Yes orderId Order reference. This field is recommended.
No customer.email E-mail address that will be used for sending the payment receipt to the buyer.
This field is recommended.
No customer.reference Buyer ID on the merchant website. This field is recommended.
No customer.billingDetails Object containing details of the billing address. This field and its attributes are recommended.
No customer.shippingDetails Object containing the details of the billing address. This field and its attributes are recommended.
No customer.shoppingCart Object containing the details of the shopping cart. This field and its attributes are recommended.
No transactionOptions.cardOptions.manualValidation Payment validation mode. No transactionOptions.cardOptions.captureDelay Capture delay. No In order to obtain a more detailed description of the fields to use, test the Charge/CreatePayment Web Service using our playground.Example request:
POST https://api.secure.osb.pf/api-payment/V4/Charge/CreatePayment
{ "amount": 10000, "currency": "XPF", "formAction": "PAYMENT", "orderId": "CMD012859" "customer": { "reference": "104123487", "email": "sample@example.com", "billingDetails": { "category": "PRIVATE", "firstName": "Moana", "lastName": "Doom", "phoneNumber": "49123456", "cellPhoneNumber": "87123456", "streetNumber": "", "address": "Rue Gauguin", "zipCode": "98713", "city": "Papeete", "country": "PF", "language": "fr" }, "shoppingCart": { "cartItemInfo": [ { "productLabel": "La Végétarienne", "productType": "FOOD_AND_GROCERY", "productRef": "ZJJ5520", "productQty": 1, "productAmount": "1273" } ] }, "shippingDetails": { "firstName": "Moana", "lastName": "Doom", "phoneNumber": "49123456", "address": "Bd de la Reine Pomare IV", "streetNumber": "8", "zipCode": "98714", "city": "Papeete", "country": "PF", "shippingMethod": "PACKAGE_DELIVERY_COMPANY" } } }
- In response, the merchant server retrieves aformToken, an encrypted object allowing to initialize the embedded form with the transaction details and the details corresponding to the shop configuration.
Example of a response
{ "webService": "Charge/CreatePayment", "version": "V4", "applicationVersion": "5.25.0", "status": "SUCCESS", "answer": { "formToken": "02izOLcBypiLCJWSVNBX0RFQklUIiwiVklTQV...", "_type": "V4/Charge/PaymentForm" }, "ticket": "111a64d6eb464bb8841f1c325af503af", "serverDate": "2021-06-29T12:37:33+00:00", "applicationProvider": "OSB", "metadata": null, "mode": "TEST", "serverUrl": "https://api.secure.osb.pf/", "_type": "V4/WebService/Response" }
- Then use the formToken present in the response to display the embedded form on your payment page.
- Once the card details are entered, the buyer is prompted to authenticate themselves.
- After authentication, the gateway proceeds with the authorization request and the buyer is redirected to the success or return page.