Интеграции Apple Pay Stripe IntegrationPhp

Кемеровские программисты php общаются здесь
Ответить
Anonymous
 Интеграции Apple Pay Stripe Integration

Сообщение Anonymous »

Это код JavaScript, который я использовал для разработки кнопки запроса на оплату Apple с помощью Stripe, где я разместил связанный код в вышеперечисленном, и я также добавил связанную библиотеку полосы v3 и добавил Div с идентификатором html < /p>

var stripe = Stripe('pk_test_ZjbcGwDeoJsycvIs7KGEFkVR00qOzHxlrX');
elements = stripe.elements();

// Config payment request
paymentRequest = stripe.paymentRequest({
country: 'US',
currency: 'usd',
total: {
label: 'Demo total',
amount: 100,
},
});
paymentRequest.on('source', function(event) {
console.log('Got source: ', event.source.id);
event.complete('success');
ChromeSamples.log(JSON.stringify(event.source, 2));
// Send the source to your server to charge it!
});
prButton = elements.create('paymentRequestButton', {
paymentRequest,
});
// Check the availability of the Payment Request API first.
paymentRequest.canMakePayment().then((result) => {
//console.log(prButton);
if (result) {
prButton.mount('#payment-request-button');
} else {
document.getElementById('payment-request-button').style.display = 'none';
ChromeSamples.setStatus("Not supported, please check: https://stripe.com/docs/elements/paymen ... on#testing");
}
});

// Helpers
var ChromeSamples = {
log: function() {
var line = Array.prototype.slice.call(arguments).map(function(argument) {
return typeof argument === 'string' ? argument : JSON.stringify(argument);
}).join(' ');

document.querySelector('#log').textContent += line + '\n';
},

clearLog: function() {
document.querySelector('#log').textContent = '';
},

setStatus: function(status) {
document.querySelector('#status').textContent = status;
},

setContent: function(newContent) {
var content = document.querySelector('#content');
while (content.hasChildNodes()) {
content.removeChild(content.lastChild);
}
content.appendChild(newContent);
}
};


Подробнее здесь: https://stackoverflow.com/questions/601 ... tegrations
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Php»