react-native-yookassa
Version:
YooKassa payments for React Native
40 lines (39 loc) • 1.36 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.YandexPayment = void 0;
var _NativeYookassa = _interopRequireDefault(require("./NativeYookassa"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
class YandexPayment {
static show(shop, payment) {
return _NativeYookassa.default.attach({
SHOP_ID: shop.id,
SHOP_TOKEN: shop.token,
SHOP_NAME: shop.name,
SHOP_RETURN_URL: shop.returnUrl ? shop.returnUrl : 'https://custom.redirect.url/',
SHOP_DESCRIPTION: shop.description,
PAYMENT_AMOUNT: payment.amount,
PAYMENT_CURRENCY: payment.currency,
PAYMENT_TYPES_ARRAY: payment.types || [],
PAYMENT_SAVE_TYPE: payment.savePaymentMethod || 'OFF',
PAYMENT_YOO_MONEY_CLIENT_ID: payment.yooKassaClientId
}).then(arr => ({
token: arr[0],
type: arr[1]
}));
}
static show3ds(requestUrl, paymentType, clientApplicationKey, shopId) {
return _NativeYookassa.default.show3ds(requestUrl, paymentType, clientApplicationKey, shopId).then(result => {
if (result !== 'RESULT_OK') {
throw new Error('3ds cancelled');
}
return result;
});
}
static close() {
return _NativeYookassa.default.close();
}
}
exports.YandexPayment = YandexPayment;
//# sourceMappingURL=YandexPayment.js.map
;