web / usePayPal
Function: usePayPal() ​
usePayPal():
object
Returns ​
object
approveOrder() ​
approveOrder: (
orderID
,payerID
) =>Promise
<null
|PayPalApproveOrder
>
Parameters ​
• orderID: string
• payerID: string
Returns ​
Promise
<null
| PayPalApproveOrder
>
ApproveOrder
Description ​
Function for approving a PayPal transaction.
Example ​
approveOrder('1', '1');
captureOrder() ​
captureOrder: (
params
) =>Promise
<null
|PayPalApproveOrder
>
Parameters ​
• params: PayPalCaptureOrderParams
Returns ​
Promise
<null
| PayPalApproveOrder
>
CaptureOrder
Description ​
Function for (re-)capturing a PayPal order.
Example ​
captureOrder({
paypalOrderId: '1';
paypalPayerId: '1';
plentyOrderId: 1; // optional: the order will be recaptured
});
config ​
config:
Ref
<null
|PayPalConfigResponse
,null
|PayPalConfigResponse
>
createCreditCardTransaction() ​
createCreditCardTransaction: () =>
Promise
<null
|PayPalCreditCardTransaction
>
Returns ​
Promise
<null
| PayPalCreditCardTransaction
>
CreateCreditCardTransaction
Description ​
Function for creating a PayPal credit card transaction.
Example ​
createCreditCardTransaction();
createTransaction() ​
createTransaction: (
fundingSource
) =>Promise
<null
|PayPalCreateOrder
>
Parameters ​
• fundingSource: string
Returns ​
Promise
<null
| PayPalCreateOrder
>
CreateTransaction
Description ​
Function for creating a PayPal transaction.
Example ​
createTransaction(fundingSource: string);
executeOrder() ​
executeOrder: (
params
) =>Promise
<null
|PayPalExecutePayment
>
Parameters ​
• params: PayPalExecuteParams
Returns ​
Promise
<null
| PayPalExecutePayment
>
ExecuteOrder
Description ​
Function for executing a PayPal transaction.
Example ​
executeOrder({
mode: 'PAYPAL',
plentyOrderId: 1234,
paypalTransactionId: 'UHIhhur3h2rh2',
});
getOrder() ​
getOrder: (
params
) =>Promise
<null
|PayPalOrderStatus
>
Parameters ​
• params: PayPalGetOrderDetailsParams
Returns ​
Promise
<null
| PayPalOrderStatus
>
getScript() ​
getScript: (
currency
,commit
) =>Promise
<null
|PayPalNamespace
>
Parameters ​
• currency: string
• commit: boolean
= false
Returns ​
Promise
<null
| PayPalNamespace
>
isAvailable ​
isAvailable:
Ref
<boolean
,boolean
> =false
isReady ​
isReady:
Ref
<boolean
,boolean
> =false
loadConfig() ​
loadConfig: () =>
Promise
<boolean
>
Returns ​
Promise
<boolean
>
Description ​
Function to get the PayPal config.
Example ​
loadConfig();
loadedConfig ​
loadedConfig:
Ref
<boolean
,boolean
> =false
loading ​
loading:
Ref
<boolean
,boolean
> =false
loadingScripts ​
loadingScripts:
Ref
<PayPalLoadScript
,PayPalLoadScript
>
order ​
order:
Ref
<null
|PayPalCreateOrder
,null
|PayPalCreateOrder
>
paypalScript ​
paypalScript:
Ref
<null
|PayPalScript
,null
|PayPalScript
>
state ​
state:
Ref
<object
,object
>
Type declaration ​
config ​
config:
null
|PayPalConfigResponse
isAvailable ​
isAvailable:
boolean
=false
isReady ​
isReady:
boolean
=false
loadedConfig ​
loadedConfig:
boolean
=false
loading ​
loading:
boolean
=false
loadingScripts ​
loadingScripts:
PayPalLoadScript
order ​
order:
null
|PayPalCreateOrder
paypalScript ​
paypalScript:
null
|PayPalScript