### Initial Payment Request (Server-to-Server Integration) Source: https://hyperpay.docs.oppwa.com/cof Example of an initial payment request using server-to-server integration to store a token for future use. This request includes parameters for Card on File setup. ```APIDOC ## POST /v1/payments ### Description Initiates the first payment in a Card on File series, storing token details for subsequent transactions. This request requires parameters to authenticate the customer and set up standing instructions. ### Method POST ### Endpoint /v1/payments ### Parameters #### Query Parameters - **entityId** (string) - Required - The unique identifier for the entity. - **amount** (string) - Required - The payment amount. - **currency** (string) - Required - The currency of the payment (e.g., SAR). - **paymentBrand** (string) - Required - The payment brand (e.g., VISA). - **paymentType** (string) - Required - The type of payment (e.g., DB). - **card.number** (string) - Required - The card number. - **card.holder** (string) - Required - The name of the cardholder. - **card.expiryMonth** (string) - Required - The expiry month of the card. - **card.expiryYear** (string) - Required - The expiry year of the card. - **card.cvv** (string) - Required - The card verification value. - **standingInstruction.mode** (string) - Required - Set to 'INITIAL' for the first payment. - **standingInstruction.source** (string) - Required - Set to 'CIT' for Card on File. - **standingInstruction.type** (string) - Required - Type of standing instruction (e.g., 'UNSCHEDULED', 'RECURRING', 'INSTALLMENT'). - **createRegistration** (boolean) - Required - Set to 'true' to create a registration for the card. ### Request Example ```curl curl https://eu-test.oppwa.com/v1/payments \ -d "entityId=8a8294174d0595bb014d05d829cb01cd" \ -d "amount=92.00" \ -d "currency=SAR" \ -d "paymentBrand=VISA" \ -d "paymentType=DB" \ -d "card.number=4200000000000000" \ -d "card.holder=Jane Jones" \ -d "card.expiryMonth=05" \ -d "card.expiryYear=2034" \ -d "card.cvv=123" \ -d "standingInstruction.mode=INITIAL" \ -d "standingInstruction.source=CIT" \ -d "standingInstruction.type=UNSCHEDULED" \ -d "createRegistration=true" \ -H "Authorization: Bearer OGE4Mjk0MTc0ZDA1OTViYjAxNGQwNWQ4MjllNzAxZDF8OVRuSlBjMm45aA==" ``` ### Response #### Success Response (200) - **result.code** (string) - Description of the result code. - **id** (string) - The unique identifier for the payment transaction. ``` -------------------------------- ### PayPal Registration Configuration Example Source: https://hyperpay.docs.oppwa.com/advanced-options This example demonstrates integrating the PayPal create registration functionality within an HTML form, including JavaScript for dynamic updates. ```html
body {background-color:#f6f6f5;} var wpwlOptions = { inlineFlow: ["PAYPAL","PAYPAL_CONTINUE"], locale: "en", style:"plain", paypal: {"createRegistration":"true"}, forter: {siteId : "1a4cd159d7ae"} } function handleClick(checkbox) { wpwlOptions.paypal.createRegistration = checkbox.checked.toString(); wpwl.reloadButton(); } $("#createRegistrationCheckbox").prop("checked", "true" === wpwlOptions.paypal.createRegistration); ``` -------------------------------- ### Enable Installment Payments (Swift) Source: https://hyperpay.docs.oppwa.com/integrations/mobile-sdk/prebuilt-ui/advanced-options Configure OPPCheckoutSettings to enable installment payments and set specific installment options. Default options are 1, 3, 5. ```swift let checkoutSettings = OPPCheckoutSettings() checkoutSettings.isInstallmentEnabled = true checkoutSettings.installmentOptions = [1, 2, 3] ``` -------------------------------- ### Enable Installment Payments (Objective-C) Source: https://hyperpay.docs.oppwa.com/integrations/mobile-sdk/prebuilt-ui/advanced-options Configure OPPCheckoutSettings to enable installment payments and set specific installment options. Default options are 1, 3, 5. ```objective-c OPPCheckoutSettings *checkoutSettings = [[OPPCheckoutSettings alloc] init]; checkoutSettings.installmentEnabled = YES; checkoutSettings.installmentOptions = @[@1, @2, @3]; ``` -------------------------------- ### Install Pods in iOS Project Source: https://hyperpay.docs.oppwa.com/integrations/mobile-sdk/brand-configurations/klarna After updating your Podfile, run this command to install the necessary dependencies for your iOS project. ```bash pod install ``` -------------------------------- ### Get Tokenization Status Source: https://hyperpay.docs.oppwa.com/widget-networktokens Retrieve the tokenization status by making a GET request to the registration endpoint using the checkout ID. This confirms the start of the network token provisioning process. ```APIDOC ## GET /v1/checkouts/{id}/registration ### Description Retrieves the status of the tokenization process. This confirms that the network token provisioning has commenced and provides transaction history. ### Method GET ### Endpoint /v1/checkouts/{id}/registration ### Parameters #### Path Parameters - **id** (string) - Required - The checkout ID obtained from the prepare checkout step. #### Query Parameters - **entityId** (string) - Required - The entity ID for the transaction. ### Request Example ```curl https://eu-test.oppwa.com/v1/checkouts/{id}/registration \ -d "entityId=8ac7a4ca8bd50add018bddc481060ab9" \ -H "Authorization: Bearer OGE4Mjk0MTc0ZDA1OTViYjAxNGQwNWQ4MjllNzAxZDF8OVRuSlBjMm45aA==" ``` ### Response #### Success Response (200) - **transactionHistory** (array) - An array detailing the token transaction history, indicating the start of the network token provisioning. - **status** (string) - The current status of the tokenization process. ``` -------------------------------- ### Initialize OPPPaymentProvider in Live Mode (Objective-C) Source: https://hyperpay.docs.oppwa.com/integrations/mobile-sdk/first-integration Configure the OPPPaymentProvider to use live credentials for production. This is a crucial step when moving from a sandbox to a live environment. ```objective-c self.provider = [OPPPaymentProvider paymentProviderWithMode:OPPProviderModeLive]; ``` -------------------------------- ### Get Payment Status Resource Path Source: https://hyperpay.docs.oppwa.com/integrations/widget This is an example of a `resourcePath` used to retrieve the payment status after a transaction. It includes the checkout ID. ```plaintext resourcePath=/v1/checkouts/{checkoutId}/payment ``` -------------------------------- ### Initialize OPPCheckoutProvider (Objective-C & Swift) Source: https://hyperpay.docs.oppwa.com/mobile-sdk-payment-button Initialize the payment provider and configure checkout settings, including payment brands and the shopper result URL. This setup is required before presenting the checkout flow. ```Objective-C OPPPaymentProvider *provider = [OPPPaymentProvider paymentProviderWithMode:OPPProviderModeTest]; OPPCheckoutSettings *checkoutSettings = [[OPPCheckoutSettings alloc] init]; checkoutSettings.paymentBrands = @[@"VISA"]; checkoutSettings.shopperResultURL = @"com.companyname.appname.payments://result"; OPPCheckoutProvider *checkoutProvider = [OPPCheckoutProvider checkoutProviderWithPaymentProvider:provider checkoutID:checkoutID settings:checkoutSettings]; ``` ```Swift let provider = OPPPaymentProvider(mode: OPPProviderMode.test) let checkoutSettings = OPPCheckoutSettings() checkoutSettings.paymentBrands = ["VISA"] checkoutSettings.shopperResultURL = "com.companyname.appname.payments://result" let checkoutProvider = OPPCheckoutProvider(paymentProvider: provider, checkoutID: checkoutID!, settings: checkoutSettings) ``` -------------------------------- ### Get Payment Status (Objective-C) Source: https://hyperpay.docs.oppwa.com/mobile-sdk-first-integration Request the payment status from your server after a transaction. Adapt the URL to your server setup. Handle potential errors and parse the JSON response. ```objective-c NSString *URL = [NSString stringWithFormat:@"https://YOUR_URL/paymentStatus?resourcePath=%@", [transaction.resourcePath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; NSURLRequest *merchantServerRequest = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:URL]]; [[[NSURLSession sharedSession] dataTaskWithRequest:merchantServerRequest completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { // handle error NSDictionary *result = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil]; BOOL status = [result[@"paymentResult"] boolValue]; }]] resume]; ``` -------------------------------- ### Get transactions for a specified time frame Source: https://hyperpay.docs.oppwa.com/reporting-transaction Retrieve a list of transactions by specifying a start and end date. You can also limit the number of results per request. If `limit` is omitted, it defaults to 100. ```APIDOC ## Get transactions for a specified time frame ### Description To retrieve a list of transactions for a specified time frame it is possible to add the `date.from` and `date.to` parameters to the request. To limit the number of entries returned for a request use the parameter `limit` (min: 100 ma: 500). If the parameter `limit` is omitted in the request, the default value of 100 will be used and, depending on the number of results, pagination will be used. Additionally, it is still possible to filter the result using `paymentTypes` and `paymentMethods` filtering options. Request must contain either `merchantTransactionId` or `date.to`/`date.from` and parameters. Please see the API Reference for further details. ### Method GET ### Endpoint /v3/query ### Query Parameters - **date.from** (string) - Required - The start date and time for the transaction search. - **date.to** (string) - Required - The end date and time for the transaction search. - **limit** (integer) - Optional - The maximum number of transactions to return (min: 100, max: 500). Defaults to 100. - **paymentTypes** (string) - Optional - Filter by payment types. - **paymentMethods** (string) - Optional - Filter by payment methods. ### Request Example ```curl curl -G https://eu-test.oppwa.com/v3/query \ -d "date.from=2023-01-01 00:00:00" \ -d "date.to=2023-01-01 01:00:00" \ -d "limit=20" \ -d "entityId=8a8294174b7ecb28014b9699220015ca" \ -H "Authorization: Bearer OGE4Mjk0MTc0YjdlY2IyODAxNGI5Njk5MjIwMDE1Y2N8ZmY0b1UhZSVlckI9YUJzQj82KyU=" ``` ``` -------------------------------- ### Initialize OPPPaymentProvider in Live Mode (Swift) Source: https://hyperpay.docs.oppwa.com/integrations/mobile-sdk/custom-ui Initialize the OPPPaymentProvider with `OPPProviderMode.live` for live transactions. Ensure your backend is configured for the live environment. ```swift let provider = OPPPaymentProvider(mode: OPPProviderMode.live) ``` -------------------------------- ### Initialize OPPPaymentProvider in Live Mode (Swift) Source: https://hyperpay.docs.oppwa.com/integrations/mobile-sdk/first-integration Set up the OPPPaymentProvider for live transactions in Swift. This ensures that your application uses the correct production endpoints and credentials. ```swift let provider = OPPPaymentProvider(mode: OPPProviderMode.live) ``` -------------------------------- ### Schedule Payment with Step Increments Source: https://hyperpay.docs.oppwa.com/subscriptions The '/' character specifies increments for time units, allowing for payments at regular intervals. For example, '0/15' in `job.minute` means every 15 minutes starting from minute 0. ```text 0/15 in the job.minute means _the minutes 0, 15, 30 and 45_ ``` ```text 3/6 in the job.hour means _every 6 hours beginning of the third hour (i.e., 3, 9, 15, 21)_ ``` ```text 4/3 in the job.month means _every 3 months starting from April (i.e., April, July, October, January)_ ``` ```text 1/5 in the job.dayOfMonth means _every 5 days beginning on the first day of the month (i.e., 1, 6, 11, 16, 21, 26)_ ``` ```text job.month=*/3 : Every 3 months starting from January ``` ```text job.minute=*/15 : Every 15 minutes starting from minute 00 ``` ```text job.hour=*/6 : Every 6 hours starting from hour 00 ``` ```text job.second=*/10 : Every 10 seconds starting from second 00 ``` ```text job.dayOfMonth=*/5 : Every 5 days starting from the 1st day of the month ``` -------------------------------- ### Initialize OppPaymentProvider in Live Mode (Java) Source: https://hyperpay.docs.oppwa.com/integrations/mobile-sdk/custom-ui Initialize the `OppPaymentProvider` with `Connnect.ProviderMode.LIVE` for live transactions. Ensure your backend is configured for the live environment. ```java OppPaymentProvider paymentProvider = new OppPaymentProvider(context, Connnect.ProviderMode.LIVE); ``` -------------------------------- ### Initialize OppPaymentProvider in Live Mode (Kotlin) Source: https://hyperpay.docs.oppwa.com/integrations/mobile-sdk/custom-ui Initialize the `OppPaymentProvider` with `Connnect.ProviderMode.LIVE` for live transactions. Ensure your backend is configured for the live environment. ```kotlin val paymentProvider = OppPaymentProvider(context, Connnect.ProviderMode.LIVE) ``` -------------------------------- ### Enable Installment Payments (Kotlin) Source: https://hyperpay.docs.oppwa.com/integrations/mobile-sdk/prebuilt-ui/advanced-options Configure CheckoutSettings to enable installment payments and set specific installment options. Default options are 1, 3, 5. ```kotlin val checkoutSettings = CheckoutSettings(checkoutId, paymentBrands, providerMode) checkoutSettings.isInstallmentEnabled = true checkoutSettings.installmentOptions = arrayOf(1, 2, 3) ``` -------------------------------- ### Enable Installment Payments (Java) Source: https://hyperpay.docs.oppwa.com/integrations/mobile-sdk/prebuilt-ui/advanced-options Configure CheckoutSettings to enable installment payments and set specific installment options. Default options are 1, 3, 5. ```java CheckoutSettings checkoutSettings = new CheckoutSettings( checkoutId, paymentBrands, providerMode); checkoutSettings.setInstallmentEnabled(true); checkoutSettings.setInstallmentOptions(new Integer[] { 1, 2, 3 }); ``` -------------------------------- ### 1. Prepare the Checkout Source: https://hyperpay.docs.oppwa.com/integrations/widget/network-tokens Initiate network token provisioning by performing a server-to-server POST request to prepare the checkout with the required customer data. The response includes an 'id' needed for the next step. ```APIDOC ## Prepare the Checkout To initiate network token provisioning, perform a server-to-server POST request to prepare the checkout with the required customer data, including `createRegistration=true` and `createOmniToken=true`, but excluding `paymentType`. The response to a successful request is an `id` required in the second step to create the tokenization form. ### Method POST ### Endpoint /v1/checkouts ### Request Body Parameters - **entityId** (string) - Required - The entity ID for your account. - **createRegistration** (boolean) - Required - Set to `true` to create a registration. - **createOmniToken** (boolean) - Required - Set to `true` to create an omni token. - **customParameters[3DS2_enrolled]** (string) - Optional - Indicates 3DS2 enrollment status. - **customParameters[3DS2_flow]** (string) - Optional - Specifies the 3DS2 flow type. - **testMode** (string) - Optional - Set to `EXTERNAL` for test mode. - **customer.givenName** (string) - Optional - The customer's first name. - **customer.ip** (string) - Optional - The customer's IP address. - **customer.surname** (string) - Optional - The customer's last name. - **customer.language** (string) - Optional - The customer's preferred language. - **customer.email** (string) - Optional - The customer's email address. - **billing.city** (string) - Optional - The billing city. - **billing.country** (string) - Optional - The billing country. - **billing.postcode** (string) - Optional - The billing postal code. - **billing.state** (string) - Optional - The billing state. - **billing.street1** (string) - Optional - The billing street address. - **integrity** (boolean) - Optional - Enables integrity checks. ### Request Example ```curl curl https://eu-test.oppwa.com/v1/checkouts \ -d "entityId=8ac7a4ca8bd50add018bddc481060ab9" \ -d "createRegistration=true" \ -d "customParameters[3DS2_enrolled]=true" \ -d "customParameters[3DS2_flow]=challenge" \ -d "testMode=EXTERNAL" \ -d "customer.givenName=Smith" \ -d "customer.ip=192.168.0.0" \ -d "customer.surname=John" \ -d "customer.language=DE" \ -d "customer.email=john.smith@gmail.com" \ -d "billing.city=MyCity" \ -d "billing.country=DE" \ -d "billing.postcode=712121" \ -d "billing.state=DE" \ -d "billing.street1=MyStreet" \ -d "integrity=true" \ -H "Authorization: Bearer OGE4Mjk0MTc0ZDA1OTViYjAxNGQwNWQ4MjllNzAxZDF8OVRuSlBjMm45aA==" ``` ### Response #### Success Response (200) - **id** (string) - The ID required for the next step in tokenization. ``` -------------------------------- ### Initialize OPPPaymentProvider in Live Mode (Objective-C) Source: https://hyperpay.docs.oppwa.com/integrations/mobile-sdk/custom-ui Initialize the OPPPaymentProvider with `OPPProviderModeLive` for live transactions. Ensure your backend is configured for the live environment. ```objective-c self.provider = [OPPPaymentProvider paymentProviderWithMode:OPPProviderModeLive]; ``` -------------------------------- ### PayPal Registration Configuration with Inline Flow Source: https://hyperpay.docs.oppwa.com/widget-advanced-options This example configures PayPal with inline flow, sets the locale and style, and includes Forter integration. It also initializes the 'createRegistration' option and ensures the checkbox state matches the configuration. ```javascript var wpwlOptions = { inlineFlow: ["PAYPAL","PAYPAL_CONTINUE"], locale: "en", style:"plain", paypal: {"createRegistration":"true"}, forter: {siteId : "1a4cd159d7ae"} } function handleClick(checkbox) { wpwlOptions.paypal.createRegistration = checkbox.checked.toString(); wpwl.reloadButton(); } $("#createRegistrationCheckbox").prop("checked", "true" === wpwlOptions.paypal.createRegistration); ``` -------------------------------- ### Throttling Error Response Example Source: https://hyperpay.docs.oppwa.com/api-reference Example JSON response when a request is rejected due to exceeding rate limits. ```json { "buildNumber": "b297e8ec4aa0888454578e292c67546d4c6a5c28@2018-08-30 06:31:46 +****", "id": "8ac9a4a8658afc790165a3f0e436198d", "ndc": "8acda4c9635ea2d90163636f0a462510_ebb07f3e26e942908d6eeed03a813237", "result": { "code": "800.120.100", "description": "Too many requests. Please try again later." }, "timestamp": "2018-09-04 09:42:33+0000" } ``` -------------------------------- ### Import OPPWAMobile Framework (Swift) Source: https://hyperpay.docs.oppwa.com/mobile-sdk-first-integration Import the OPPWAMobile framework for Swift projects. ```swift import OPPWAMobile ``` -------------------------------- ### Get Payment Status Source: https://hyperpay.docs.oppwa.com/widget-registrationtokens Retrieve the payment status after the request is processed. The customer is redirected to your `shopperResultUrl` with a GET parameter `resourcePath`. ```APIDOC ## Get the payment status ### Description Once the payment request is processed, the customer is redirected to your `shopperResultUrl` along with a GET parameter `resourcePath` which contains the path to the payment resource. ### Method GET ### Endpoint /v1/checkouts/{id}/payment ### Parameters #### Path Parameters - **id** (string) - Required - The checkout ID. #### Query Parameters - **entityId** (string) - Required - The entity ID for your merchant account. #### Headers - **Authorization** (string) - Required - Bearer token for authentication. ### Request Example ```curl curl -G https://eu-test.oppwa.com/v1/checkouts/{id}/payment \ -d "entityId=8a8294174d0595bb014d05d829cb01cd" \ -H "Authorization: Bearer OGE4Mjk0MTc0ZDA1OTViYjAxNGQwNWQ4MjllNzAxZDF8OVRuSlBjMm45aA==" ``` ``` -------------------------------- ### Configure CheckoutSettings with Payment Brands (Java) Source: https://hyperpay.docs.oppwa.com/integrations/mobile-sdk/prebuilt-ui/payment-button Set up CheckoutSettings to specify the payment brands available to the shopper. This example includes VISA and MASTER. ```java Set paymentBrands = new LinkedHashSet(); paymentBrands.add("VISA"); paymentBrands.add("MASTER"); CheckoutSettings checkoutSettings = new CheckoutSettings(checkoutId, paymentBrands, Connect.ProviderMode.TEST); // since mSDK version 6.0.0 the shopper result URL is not required checkoutSettings.setShopperResultUrl("companyname://result"); ``` -------------------------------- ### Configure PayPal SDK Parameters Source: https://hyperpay.docs.oppwa.com/integrations/widget/fast-checkout/paypal Use the `sdkParams` option to pass PayPal SDK query parameters. This example shows how to enable components, specific funding sources, and enable debug mode. ```javascript sdkParams:{ components: "buttons, messages", "enable-funding": "paylater", debug: "true" } ``` -------------------------------- ### 3. Get the Tokenization Status Source: https://hyperpay.docs.oppwa.com/integrations/widget/network-tokens Retrieve the tokenization status after the request is processed. The customer is redirected to your `shopperResultUrl` with a `resourcePath` GET parameter. ```APIDOC ## Get the Tokenization Status Once the tokenization request is processed, the customer is redirected to your `shopperResultUrl` along with a GET parameter `resourcePath`. ### Resource Path `/v1/checkouts/{checkoutId}/registration` ### Tokenization Response The response will include a token transaction history, indicating that the network token provisioning process has started with the card network. This process involves the issuer and may take some time for approval. In the test environment, there is a simulated 2-second delay to mirror production conditions. The network token will be retrieved during the next payment attempt. ### Method GET ### Endpoint /v1/checkouts/{id}/registration ### Query Parameters - **entityId** (string) - Required - The entity ID for your account. ### Request Example ```curl curl -G https://eu-test.oppwa.com/v1/checkouts/{id}/registration \ -d "entityId=8ac7a4ca8bd50add018bddc481060ab9" \ -H "Authorization: Bearer OGE4Mjk0MTc0ZDA1OTViYjAxNGQwNWQ4MjllNzAxZDF8OVRuSlBjMm45aA==" ``` ``` -------------------------------- ### Initial Payment Request Parameters (INSTALLMENT) Source: https://hyperpay.docs.oppwa.com/recurring Use these parameters for the initial payment when the customer is present and the transaction is part of an installment plan. ```text standingInstruction.mode=INITIAL standingInstruction.type=INSTALLMENT standingInstruction.source=CIT ``` -------------------------------- ### Initiate Network Token Provisioning (Prepare Checkout) Source: https://hyperpay.docs.oppwa.com/widget-networktokens Server-to-server POST request to prepare the checkout and initiate network token provisioning. This requires merchant token IDs and returns an ID for the next step. ```APIDOC ## Prepare the Checkout ### Description Initiates network token provisioning by sending payment data and merchant token IDs to prepare the checkout form. ### Method POST ### Endpoint /v1/checkouts ### Parameters #### Query Parameters - **entityId** (string) - Required - The merchant's entity ID. - **registrations[n].id** (string) - Required - The ID of the stored card on file (token ID). - **amount** (string) - Required - The transaction amount. - **currency** (string) - Required - The transaction currency. - **paymentType** (string) - Required - The type of payment. - **standingInstruction.mode** (string) - Required - The mode for standing instructions. - **standingInstruction.source** (string) - Required - The source of the standing instruction. - **standingInstruction.type** (string) - Required - The type of standing instruction. - **customer.givenName** (string) - Optional - The customer's first name. - **customer.ip** (string) - Optional - The customer's IP address. - **customer.surname** (string) - Optional - The customer's last name. - **customer.language** (string) - Optional - The customer's language. - **customer.email** (string) - Optional - The customer's email address. - **billing.city** (string) - Optional - The billing city. - **billing.country** (string) - Optional - The billing country. - **billing.postcode** (string) - Optional - The billing postcode. - **billing.state** (string) - Optional - The billing state. - **billing.street1** (string) - Optional - The billing street address. - **customParameters[3DS2_enrolled]** (string) - Optional - Indicates 3DS2 enrollment status. - **customParameters[3DS2_flow]** (string) - Optional - Specifies the 3DS2 flow type. - **testMode** (string) - Optional - Enables test mode. - **integrity** (string) - Optional - Indicates data integrity. ### Request Example ```curl https://eu-test.oppwa.com/v1/checkouts \ -d "entityId=8ac7a4ca8bd50add018bddc481060ab9" \ -d "customParameters[3DS2_enrolled]=true" \ -d "customParameters[3DS2_flow]=challenge" \ -d "testMode=EXTERNAL" \ -d "registrations[0].id=8ac7a4a19e3f6de4019e40a0899b147b" \ -d "registrations[1].id=8ac7a4a19e3f6de4019e40a08a831484" \ -d "registrations[2].id=8ac7a4a19e3f6de4019e40a08ba6148d" \ -d "amount=11.13" \ -d "currency=EUR" \ -d "paymentType=DB" \ -d "standingInstruction.mode=REPEATED" \ -d "standingInstruction.source=CIT" \ -d "standingInstruction.type=UNSCHEDULED" \ -d "customer.givenName=Smith" \ -d "customer.ip=192.168.0.0" \ -d "customer.surname=John" \ -d "customer.language=DE" \ -d "customer.email=john.smith@gmail.com" \ -d "billing.city=MyCity" \ -d "billing.country=DE" \ -d "billing.postcode=712121" \ -d "billing.state=DE" \ -d "billing.street1=MyStreet" \ -d "integrity=true" \ -H "Authorization: Bearer OGE4Mjk0MTc0ZDA1OTViYjAxNGQwNWQ4MjllNzAxZDF8OVRuSlBjMm45aA==" ``` ``` -------------------------------- ### Server-to-Server - Get Payment Status Throttling Source: https://hyperpay.docs.oppwa.com/api-reference Limits GET requests to /v1/payments/{paymentId} to 2 per minute based on paymentId. ```bash GET /v1/payments/{paymentId} max-amount-request: 2 time-unit: minute ``` -------------------------------- ### Initialize Klarna View with Client Token Source: https://hyperpay.docs.oppwa.com/integrations/mobile-sdk/brand-configurations/klarna Initialize the Klarna view with the client token and return URL received from the mSDK. This is a prerequisite for authorizing the session. ```Objective-C NSString *clientToken = transaction.brandSpecificInfo[OPPTransactionKlarnaInlineClientTokenKey]; [klarnaPaymentView initializeWithClientToken:clientToken returnUrl:transaction.paymentParams.shopperResultURL]; ``` ```Swift let clientToken = transaction.brandSpecificInfo[OPPTransactionKlarnaInlineClientTokenKey] klarnaPaymentView.initialize(clientToken: clientToken, returnUrl: transaction.paymentParams.shopperResultURL) ``` ```Java String clientToken = transaction.getBrandSpecificInfo().get(Transaction.KLARNA_INLINE_CLIENT_TOKEN_KEY); klarnaPaymentsView.initialize(clientToken, transaction.getPaymentParams().getShopperResultUrl()); ``` ```Kotlin val clientToken = transaction.brandSpecificInfo[Transaction.KLARNA_INLINE_CLIENT_TOKEN_KEY] klarnaPaymentsView.initialize(clientToken, transaction.paymentParams.shopperResultUrl) ``` -------------------------------- ### Get the registration status Source: https://hyperpay.docs.oppwa.com/integrations/widget/registration-tokens After tokenization, the customer is redirected to your `shopperResultUrl` with a `resourcePath` GET parameter. Use this path to retrieve the registration status. ```APIDOC ## Get the registration status Once the tokenization request is processed, the customer is redirected to your `shopperResultUrl` along with a GET parameter `resourcePath`. ``` resourcePath=/v1/checkouts/{checkoutId}/registration ``` **Sample request:** ```curl curl -G https://eu-test.oppwa.com/v1/checkouts/{id}/registration \ -d "entityId=8a8294174d0595bb014d05d829cb01cd" \ -H "Authorization: Bearer OGE4Mjk0MTc0ZDA1OTViYjAxNGQwNWQ0ZDQ1ZDg2MmRjMDFjZDF8OVRuSlBjMm45aQ==" ``` ``` -------------------------------- ### Initialize OPPPaymentProvider (iOS Swift) Source: https://hyperpay.docs.oppwa.com/integrations/mobile-sdk/custom-ui/bin-detection Initialize the OPPPaymentProvider in test mode. This is a prerequisite for making payment-related requests. ```swift self.provider = OPPPaymentProvider(mode: .test) ``` -------------------------------- ### COPYandPAY - Get Payment Status Throttling Source: https://hyperpay.docs.oppwa.com/api-reference Limits GET requests to /v1/checkouts/{checkoutId}/payment to 9 per minute based on checkoutId. ```bash GET /v1/checkouts/{checkoutId}/payment max-amount-request: 9 time-unit: minute ``` -------------------------------- ### Initialize OppPaymentProvider (Android Kotlin) Source: https://hyperpay.docs.oppwa.com/integrations/mobile-sdk/custom-ui/bin-detection Initialize the OppPaymentProvider in test mode. This is a prerequisite for making payment-related requests. ```kotlin val paymentProvider = OppPaymentProvider(context, Connnect.ProviderMode.TEST) ``` -------------------------------- ### Get Payment Status Resource Path Source: https://hyperpay.docs.oppwa.com/initial-payment The `resourcePath` is provided as a GET parameter upon shopper redirection, used to retrieve the payment status. ```plaintext /v1/payments/{id} ``` -------------------------------- ### Initialize OPPWpwlOptions with Configuration (Swift) Source: https://hyperpay.docs.oppwa.com/integrations/mobile-sdk/prebuilt-ui/advanced-options Initializes `OPPWpwlOptions` with configuration and JavaScript functions. Use this to set options like locale and callbacks for COPYandPAY integration. ```swift var config = [ "locale" : "fr-BE" ] var jsConfig = [ "onReady" : "function() {/* function here */} " ] as [String : Any] let wpwlOptions = OPPWpwlOptions.initWithConfiguration( config , jsFunctions: jsConfig) ``` -------------------------------- ### Import OPPWAMobile Framework (Objective-C) Source: https://hyperpay.docs.oppwa.com/mobile-sdk-first-integration Import the OPPWAMobile framework for Objective-C projects. ```objective-c #import ``` -------------------------------- ### Standing Instruction Parameters Source: https://hyperpay.docs.oppwa.com/reference/parameters Parameters related to standing instructions for recurring or installment payments, including expiry, frequency, number of installments, and agreement ID. ```APIDOC ## Standing Instruction Parameters ### standingInstruction.expiry - **Description**: Date after which no further authorizations will be performed. Used for authentication request during EMV 3D. - **For MasterCard**: If not sent, defaults to 9999-12-31. - **For other brands**: If not sent, sends an authentication request with indicator "payment". - **Type**: yyyy-mm-dd - **Condition**: Conditional (mandatory when processing 3D Secure on recurring or installment transactions). ### standingInstruction.frequency - **Description**: Indicates the minimum number of days between authorizations. - **For MasterCard**: If not sent, defaults to 0001. - **For other brands**: If not sent, sends an authentication request with indicator "payment". - **Type**: N4 - **Condition**: Conditional (mandatory when processing 3D Secure on recurring or installment transactions). ### standingInstruction.numberOfInstallments - **Description**: Indicates the maximum number of authorizations permitted for installment payments. Required if the Merchant and Cardholder have agreed to installment payments, and EMV 3D authentication is configured. - **Type**: N3 - **Condition**: Conditional (mandatory when processing 3D Secure on installment transactions). ### standingInstruction.agreementId - **Description**: Used for Mastercard transactions to transmit the Economically Related Transaction ID (TLID), which identifies and links transactions associated with the same standing instruction agreement. During a transitional period, both standingInstruction.initialTransactionId and standingInstruction.agreementId will be returned by Mastercard and are expected to be provided in MIT requests. After the transition period, only standingInstruction.agreementId will be returned in responses and expected in requests. - **Type**: AN35 - **Condition**: Optional ``` -------------------------------- ### Example HTTP Response Body Source: https://hyperpay.docs.oppwa.com/api-reference This is an example of a successful HTTP 200 response from the OPP API. It includes details about the transaction, card, and risk assessment. ```json HTTP 200 { "id":"8ac7a4a289d210fc0189d5b4e9572cc8", "paymentType":"DB", "paymentBrand":"VISA", "amount":"92.00", "currency":"EUR", "descriptor":"7766.2840.5126 OPP_Channel ", "result":{ "code":"000.100.110", "description":"Request successfully processed in 'Merchant in Integrator Test Mode'" }, "resultDetails":{ "ExtendedDescription":"Authorized", "clearingInstituteName":"Your Clearing Institute Name", "ConnectorTxID1":"00000000776628405126", "ConnectorTxID3":"0170|085", "ConnectorTxID2":"012416", "AcquirerResponse":"0000" }, "card":{ "bin":"420000", "last4Digits":"0000", "holder":"Jane Jones", "expiryMonth":"05", "expiryYear":"2034" }, "risk":{ "score":"100" }, "buildNumber":"5ce30a257f96b238fa8ecc669ffdc2a77040ba35@2023-08-08 07:36:04 +0000", "timestamp":"2023-08-08 15:12:30.752+0000", "ndc":"8a8294174b7ecb28014b9699220015ca_83281e556b1e4216bef5c3bc1f63c45c" } ``` -------------------------------- ### Prepare the Checkout Source: https://hyperpay.docs.oppwa.com/widget-registrationtokens Initiate the registration token process by making a server-to-server POST request with 'createRegistration=true'. This prepares the checkout and returns an 'id' needed for the next step. ```APIDOC ## POST /v1/checkouts ### Description Prepares the checkout process for tokenization by enabling registration. ### Method POST ### Endpoint /v1/checkouts ### Parameters #### Query Parameters - **entityId** (string) - Required - The entity ID for your account. - **testMode** (string) - Optional - Set to 'EXTERNAL' for testing. - **createRegistration** (boolean) - Required - Set to 'true' to enable registration token creation. ### Request Example ```curl curl https://eu-test.oppwa.com/v1/checkouts \ -d "entityId=8a8294174d0595bb014d05d829cb01cd" \ -d "testMode=EXTERNAL" \ -d "createRegistration=true" \ -H "Authorization: Bearer OGE4Mjk0MTc0ZDA1OTViYjAxNGQwNWQ4MjllNzAxZDF8OVRuSlBjMm45aA==" ``` ``` -------------------------------- ### COPYandPAY - Get Payment Status Throttling Source: https://hyperpay.docs.oppwa.com/reference/parameters Limits GET requests to the /v1/checkouts/{checkoutId}/payment endpoint to 9 per minute per checkoutId. ```http GET /v1/checkouts/{checkoutId}/payment max-amount-request: 9 time-unit: minute ``` -------------------------------- ### Get Registration Status Source: https://hyperpay.docs.oppwa.com/integrations/widget/registration-tokens Retrieve the status of the registration tokenization process. The `resourcePath` parameter, received as a GET parameter on the `shopperResultUrl`, is used to construct the request. ```curl curl -G https://eu-test.oppwa.com/v1/checkouts/{id}/registration \ -d "entityId=8a8294174d0595bb014d05d829cb01cd" \ -H "Authorization: Bearer OGE4Mjk0MTc0ZDA1OTViYjAxNGQwNWQ4MjllNzAxZDF8OVRuSlBjMm45aA==" ``` -------------------------------- ### Import OPPWAMobile SDK in Objective-C Source: https://hyperpay.docs.oppwa.com/integrations/mobile-sdk/first-integration Import the OPPWAMobile framework in your Objective-C project. Ensure the framework is correctly added to your project. ```objectivec #import ```