我使用https://developer.paypal.com/docs/api/vault/#credit-card_create使用gem 'typhoeus'
将信用卡详细信息存储在PayPal保险库中。我已经按照paypal api提供的步骤进行了操作,但我得到了 INTERNAL_SERVICE_ERROR 。这就是我为存储信用卡所做的工作。请给我建议我的代码。谢谢大家。
credit_card = {
number: "4417119669820331",
type: "visa",
expire_month: 11,
expire_year: 2018,
cvv2: "874",
first_name: "Joe",
last_name: "Shopper",
billing_address: {
line1: "52 N Main St.",
city: "Johnstown",
country_code: "US",
postal_code: "43210",
state: "OH",
phone: "408-334-8890"
},
external_customer_id: "joe_shopper408-334-8890"
}
result = Typhoeus.post('https://api.sandbox.paypal.com/v1/vault/credit-cards' ,:headers => { 'Content-Type' => 'application/json', "Authorization" => "Bearer *****************"}, :params => credit_card)
Yajl::Parser.parse(result.body)
render json: { status: 200 }