【问题标题】:Payment gateway choice支付网关选择
【发布时间】:2016-10-07 02:51:38
【问题描述】:

我现在已经为支付选项开发了 iphone 应用程序我无法下定决心,这是最好的 1. PayPal 2. Braintree。

我想在每次使用时保存用户的付款信息。所以只有一次用户必须填写信息,我可以使用下次保存的信息进行付款。就像 UBER 应用做的那样……这可能在移动应用端吗?

【问题讨论】:

  • 是的,有可能。
  • 我建议您更改您的问题,以便您明确表示保存卡和帐单详细信息。保存名称、登录详细信息等是另一个问题的范围这就是该问题被否决的原因

标签: php ios objective-c payment-gateway


【解决方案1】:

您可以使用 Paypal 来满足您的要求,并且 Paypal 直接不提供任何凭据,或者您必须在填充信息时访问该特定用户的令牌。该令牌由 paypal 提供(只是认为它就像在您的应用中记住我一样)。

注意:我自己没有实现这个,但我认为这一定是方法。

【讨论】:

    【解决方案2】:

    是的,您可以使用 paypal 通过他们的 rest api 来保存卡

    以下是来自 api 示例和文档站点的 paypal 代码 http://paypal.github.io/PayPal-PHP-SDK/

    // # Create Credit Card Sample
    // You can store credit card details securely
    // with PayPal. You can then use the returned
    // Credit card id to process future payments.
    // API used: POST /v1/vault/credit-card
    
    
    require __DIR__ . '/../bootstrap.php';
    use PayPal\Api\CreditCard;
    
    // ### CreditCard
    // A resource representing a credit card that is 
    // to be stored with PayPal.
    $card = new CreditCard();
    $card->setType("visa")
        ->setNumber("4917912523797702")
        ->setExpireMonth("11")
        ->setExpireYear("2019")
        ->setCvv2("012")
        ->setFirstName("Joe")
        ->setLastName("Shopper");
    
    // ### Additional Information
    // Now you can also store the information that could help you connect
    // your users with the stored credit cards.
    // All these three fields could be used for storing any information that could help merchant to point the card.
    // However, Ideally, MerchantId could be used to categorize stores, apps, websites, etc.
    // ExternalCardId could be used for uniquely identifying the card per MerchantId. So, combination of "MerchantId" and "ExternalCardId" should be unique.
    // ExternalCustomerId could be userId, user email, etc to group multiple cards per user.
    $card->setMerchantId("MyStore1");
    $card->setExternalCardId("CardNumber123" . uniqid());
    $card->setExternalCustomerId("123123-myUser1@something.com");
    
    // For Sample Purposes Only.
    $request = clone $card;
    
    // ### Save card
    // Creates the credit card as a resource
    // in the PayPal vault. The response contains
    // an 'id' that you can use to refer to it
    // in future payments.
    // (See bootstrap.php for more on `ApiContext`)
    try {
        $card->create($apiContext);
    } catch (Exception $ex) {
        // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
        ResultPrinter::printError("Create Credit Card", "Credit Card", null, $request, $ex);
        exit(1);
    }
    
    // NOTE: PLEASE DO NOT USE RESULTPRINTER CLASS IN YOUR ORIGINAL CODE. FOR SAMPLE ONLY
     ResultPrinter::printResult("Create Credit Card", "Credit Card", $card->getId(), $request, $card);
    
    return $card;
    

    欲了解更多信息@https://developer.paypal.com/docs/integration/direct/rest-vault-overview/

    【讨论】:

      猜你喜欢
      • 2018-10-19
      • 2019-06-15
      • 2016-02-25
      • 2016-06-16
      • 1970-01-01
      • 2011-01-07
      • 1970-01-01
      • 2011-12-30
      • 2010-12-10
      相关资源
      最近更新 更多