Как проверить транзакцию Venmo на песочнице для IOS? - PullRequest
0 голосов
/ 28 сентября 2019

Я пытаюсь проверить транзакцию Venmo в песочнице в моем приложении javascript реагировать + метеор.Каждый раз, когда мы вводим нашу сумму и нажимаем кнопку Venmo, мы перенаправляемся в Venmo и просим добавить кредитную карту или банк.

Мы попытались добавить фиктивные номера карт, данные Braintree, но получили следующую ошибку: Отсутствует или недействителен cvv или срок действия.

Мы также пытались использовать fake-venmo-account-nonce, но запустилив ту же проблему.

СТОРОНА КЛИЕНТА:

    // Create a Venmo component.
      var venmoButton = document.getElementById('venmo-button');
      braintree.venmo.create({
        client: clientInstance
      },function (venmoErr, venmoInstance) {
        if (venmoErr) {
          console.error('Error creating Venmo:', venmoErr);
          return;
        }

        Verify browser support before proceeding.
        if (!venmoInstance.isBrowserSupported()) {
          console.log('Browser does not support Venmo');
          return;
        }
        //moved inside Meteor.call
        function displayVenmoButton(venmoInstance) {
          // Assumes that venmoButton is initially display: none.
          venmoButton.style.display = 'block';

          venmoButton.addEventListener('click', function () {
            venmoButton.disabled = true;

            venmoInstance.tokenize(function (tokenizeErr, payload) {
              venmoButton.removeAttribute('disabled');

            });
          });
        }

СТОРОНА СЕРВЕРА:

createTransaction: function(nonceFromTheClient, donation_amount) {
var user = Meteor.user();

// Let's create transaction.
gateway.transaction.sale({
  amount: donation_amount,
  paymentMethodNonce: nonceFromTheClient, // Generated nonce passed from client
  customer: {
    id: user.customerId
  },
  options: {
    submitForSettlement: true, // Payment is submitted for settlement immediatelly
    storeInVaultOnSuccess: true // Store customer in Braintree's Vault
  }
}, function (err, success) {
  if (err) {
    console.log(err);
  } else {
    // When payment's successful, add "paid" role to current user.
    Roles.addUsersToRoles(user._id, 'paid', Roles.GLOBAL_GROUP)
  }
});

}

...