Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ const {
shippingAddressRequired: false,
userAction: 'commit', // display 'Pay Now' on the PayPal review page
// one of 'authorize', 'sale', 'order'. defaults to 'authorize'. see details here: https://developer.paypal.com/docs/api/payments/v1/#payment-create-request-body
intent: 'authorize',
intent: 'authorize',
// support pay later offers. see details here: https://developer.paypal.com/braintree/docs/guides/paypal/pay-later-offers/android/v3
offerPayLater: false,
}
);

Expand Down
2 changes: 2 additions & 0 deletions android/src/main/java/com/smarkets/paypal/RNPaypalModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public void requestOneTimePayment(
PayPalRequest request = new PayPalRequest(options.getString("amount"))
.intent(PayPalRequest.INTENT_AUTHORIZE);

if (options.hasKey("offerPayLater"))
request.offerPayLater(options.getBoolean("offerPayLater"));
if (options.hasKey("currency"))
request.currencyCode(options.getString("currency"));
if (options.hasKey("displayName"))
Expand Down
2 changes: 2 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,15 @@ declare function requestOneTimePayment(token: string, {
shippingAddressRequired,
userAction,
intent,
offerPayLater,
}: {
amount: string,
currency ? : paypalSupportedCurrencies,
localeCode ? : paypalLocalCodes,
shippingAddressRequired ? : boolean,
userAction ? : 'commit' | 'continue',
intent ? : 'sale' | 'authorize' | 'order',
offerPayLater ? : boolean,
}): Promise <PaypalResponse> ;

declare function requestBillingAgreement(token: string, {
Expand Down
2 changes: 2 additions & 0 deletions ios/RNPaypal.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ + (BOOL)requiresMainQueueSetup
payPalDriver.appSwitchDelegate = self;

BTPayPalRequest *request= [[BTPayPalRequest alloc] initWithAmount:options[@"amount"]];
BOOL offerPayLater = [options[@"offerPayLater"] boolValue];
if (offerPayLater) request.offerPayLater = offerPayLater;
NSString* currency = options[@"currency"];
if (currency) request.currencyCode = currency;
NSString* displayName = options[@"displayName"];
Expand Down