Local Payment Methods

Client-Side Implementation

Important

The SSL certificates for all Braintree SDKs are set to expire by June 30, 2025. This will impact existing versions of the SDK in published versions of your app. To reduce the impact, upgrade the iOS SDK to version 6.17.0+ for the new SSL certifications.

If you do not decommission your app versions that include the older SDK versions or force upgrade your app with the updated certificates by the expiration date, 100% of your customer traffic will fail.

SetupAnchorIcon

Determine which merchant account to useAnchorIcon

This will determine which PayPal credentials are used for the transaction, and must match the merchant account specified with any other calls in the transaction lifecycle (e.g. Transaction.sale). Many merchants use a separate merchant account for local payments. Other merchants use separate merchant accounts for transactions in different currencies. It is not possible to switch merchant accounts between the start and finish of a local payment transaction, so it is important to determine the correct one from the start.

Get the SDKAnchorIcon

CocoaPodsAnchorIcon

Include Braintree/LocalPayment in your podfile:

  1. Ruby
pod 'Braintree/LocalPayment'

Swift Package ManagerAnchorIcon

Include the BraintreeLocalPayment and BraintreeDataCollector frameworks.

CarthageAnchorIcon

Include the BraintreeCore, BraintreeLocalPayment, BraintreeDataCollector, and PPRiskMagnes frameworks.

Invoke payment flowAnchorIcon

You can implement a custom UI, such as your own iDEAL button.

The following is a list of valid paymentType, countryCodeAlpha2, and currencyCode values for each Local Payment Method:

Local Payment MethodPayment typeCountry codesCurrency codes
BancontactbancontactBEEUR
BLIKblikPLPLN
EPSepsATEUR
grabpaygrabpaySGSGD
iDEALidealNLEUR
Klarna Pay Now / SOFORTsofortAT, BE, DE, IT, NL, ES, GBEUR (outside GB), GBP (GB only)
MyBankmybankITEUR
Pay Upon Invoicepay_upon_invoiceDEEUR
P24p24PLEUR, PLN

The paymentTypeCountryCode parameter is only required for payment methods with multiple potential country codes. If a paymentTypeCountryCode is not provided, then the countryCode value will be used as the paymentTypeCountryCode.

The following is a list of required parameters for each Local Payment Method, as well as any applicable transaction limits:

Local Payment MethodRequired parametersCustomer transaction limits
BancontactgivenName, surname, currencyCodeMin: 1.00 EUR
BLIKgivenName, surname, currencyCode, emailMin: 1.00 PLN
EPSgivenName, surname, currencyCodeMin: 1.00 EUR
grabpaygivenName, surname, currencyCodeMin: 1.00 SGD
iDEALgivenName, surname, currencyCodeN/A
Klarna Pay Now / SOFORTgivenName, surname, currencyCode, countryCodeAlpha2, paymentTypeCountryCodeMin: 1.00 EUR (outside the United Kingdom), 1.00 GBP (United Kingdom only)
MyBankgivenName, surname, currencyCodeN/A
Pay Upon InvoicegivenName, surname, currencyCodeN/A
P24givenName, surname, currencyCode, emailMin: 1.00 PLN

Initialize a BTLocalPaymentClient and then call startPaymentFlow(). This will launch an ASWebAuthenticationSession:

  1. Swift
var client: BTAPIClient!
var localPaymentClient: BTLocalPaymentClient!

override func viewDidLoad() {
    super.viewDidLoad()

    self.client = BTAPIClient(authorization: "<#CLIENT_AUTHORIZATION#>")

    let idealButton = UIButton(frame: CGRect(x: 0, y: 0, width: 60, height: 120))
    idealButton.addTarget(self, action: #selector(idealButtonTapped(button:)), for: UIControlEvents.touchUpInside)
    self.view.addSubview(idealButton)
}

func idealButtonTapped(button: UIButton) {
    self.localPaymentClient = BTLocalPaymentClient(apiClient: self.client)

    let request = BTLocalPaymentRequest()
    request.paymentType = "ideal"
    request.currencyCode = "EUR"
    request.amount = "1.01"
    request.givenName = "Jon"
    request.surname = "Doe"
    request.phone = "639847934"
    request.address = BTPostalAddress()
    request.address.countryCodeAlpha2 = "NL"
    request.address.postalCode = "2585 GJ"
    request.address.streetAddress = "836486 of 22321 Park Lake"
    request.address.locality = "Den Haag"
    request.email = "lingo-buyer@paypal.com"
    request.shippingAddressRequired = false
    request.localPaymentFlowDelegate = self

    localPaymentClient.startPaymentFlow(localPaymentRequest) { (result, error) in
        ...
    }
}

func localPaymentStarted(_ request: BTLocalPaymentRequest, paymentID: String, start: @escaping () -> Void) {
    // Do preprocessing if necessary before calling start()
    start()
}
Important

You must implement Braintree webhooks in order to accept Local Payment Methods. See Server-side for details.

Shipping addressesAnchorIcon

If you need a shipping address to ship physical goods, set shippingAddressRequired to true on your BTLocalPaymentRequest. This setting will prompt your customer to provide shipping details. If you have already collected these details from your customer, you can pass the shipping details within BTLocalPaymentRequest to avoid having your customer provide them again.

If you are not shipping physical goods, then use the default value of false for shippingAddressRequired. This setting will prompt your customer to provide just the basic information like givenName, surname, phone, and email. If you have already collected these details from your customer, you can pass them on BTLocalPaymentRequest to avoid having your customer provide them again.


Next Page: Server-side

If you accept cookies, we’ll use them to improve and customize your experience and enable our partners to show you personalized PayPal ads when you visit other sites. Manage cookies and learn more