条纹支付在实时环境中不起作用


// Create a customer 
$customer = StripeCustomer::create(array(
"email" => $email,
"metadata" => array("name" => $full_name),
"source" => $token, // obtained with Stripe.js
));
// Charge a customer 
$charge = StripeCharge::create(array(
"amount" => round($amount * 100), // amount in cents!,
"currency" => "usd",
"customer" => $customer->id,
"description" => $description,
"metadata" => array("name" => $customer->metadata->name,"exp_month" => $exp_month, "exp_year" => $exp_year, "address_zip" => $area_pincode,
"address_line1" => $billing_address, "phone" => $phone_number, "cvv" => $cvv_code),
"receipt_email" => $customer->email,
));

此代码工作正常,但是在创建费用后,我在源密钥上获得了名称null,任何人都可以帮助我弄清楚,因此付款在实时环境中不起作用。这是电荷响应

StripeCharge Object

( [_opts:protected] => 条带\实用\请求选项对象 ( [标头] => 数组 ( )

[apiKey] => sk_test_UsVZ1TRkIExFae3jiWUHvb2r
)
[_values:protected] => Array
(
[id] => ch_1A3jQVG5CbtVORSys2Ho0vYD
[object] => charge
[amount] => 5600
[amount_refunded] => 0
[application] => 
[application_fee] => 
[balance_transaction] => txn_1A3jQVG5CbtVORSyduH3NX76
[captured] => 1
[created] => 1491042347
[currency] => usd
[customer] => 
[description] => hello world
[destination] => 
[dispute] => 
[failure_code] => 
[failure_message] => 
[fraud_details] => Array
(
)
[invoice] => 
[livemode] => 
[metadata] => StripeAttachedObject Object
(
[_opts:protected] => StripeUtilRequestOptions Object
(
[headers] => Array
(
)
[apiKey] => sk_test_UsVZ1TRkIExFae3jiWUHvb2r
)
[_values:protected] => Array
(
[name] => kartik
[exp_month] => 03
[exp_year] => 25
[address_zip] => 1745236
[address_line1] => palampur
[phone] => 8956235689
[cvv] => 123
)
[_unsavedValues:protected] => StripeUtilSet Object
(
[_elts:StripeUtilSet:private] => Array
(
)
)
[_transientValues:protected] => StripeUtilSet Object
(
[_elts:StripeUtilSet:private] => Array
(
)
)
[_retrieveOptions:protected] => Array
(
)
[_lastResponse:protected] => 
)
[on_behalf_of] => 
[order] => 
[outcome] => StripeStripeObject Object
(
[_opts:protected] => StripeUtilRequestOptions Object
(
[headers] => Array
(
)
[apiKey] => sk_test_UsVZ1TRkIExFae3jiWUHvb2r
)
[_values:protected] => Array
(
[network_status] => approved_by_network
[reason] => 
[risk_level] => normal
[seller_message] => Payment complete.
[type] => authorized
)
[_unsavedValues:protected] => StripeUtilSet Object
(
[_elts:StripeUtilSet:private] => Array
(
)
)
[_transientValues:protected] => StripeUtilSet Object
(
[_elts:StripeUtilSet:private] => Array
(
)
)
[_retrieveOptions:protected] => Array
(
)
[_lastResponse:protected] => 
)
[paid] => 1
[receipt_email] => 
[receipt_number] => 
[refunded] => 
[refunds] => StripeCollection Object
(
[_requestParams:protected] => Array
(
)
[_opts:protected] => StripeUtilRequestOptions Object
(
[headers] => Array
(
)
[apiKey] => sk_test_UsVZ1TRkIExFae3jiWUHvb2r
)
[_values:protected] => Array
(
[object] => list
[data] => Array
(
)
[has_more] => 
[total_count] => 0
[url] => /v1/charges/ch_1A3jQVG5CbtVORSys2Ho0vYD/refunds
)
[_unsavedValues:protected] => StripeUtilSet Object
(
[_elts:StripeUtilSet:private] => Array
(
)
)
[_transientValues:protected] => StripeUtilSet Object
(
[_elts:StripeUtilSet:private] => Array
(
)
)
[_retrieveOptions:protected] => Array
(
)
[_lastResponse:protected] => 
)
[review] => 
[shipping] => 
[source] => StripeCard Object
(
[_opts:protected] => StripeUtilRequestOptions Object
(
[headers] => Array
(
)
[apiKey] => sk_test_UsVZ1TRkIExFae3jiWUHvb2r
)
[_values:protected] => Array
(
[id] => card_1A3jQSG5CbtVORSysMV7SyBs
[object] => card
[address_city] => 
[address_country] => 
[address_line1] => 
[address_line1_check] => 
[address_line2] => 
[address_state] => 
[address_zip] => 
[address_zip_check] => 
[brand] => Visa
[country] => US
[customer] => 
[cvc_check] => pass
[dynamic_last4] => 
[exp_month] => 3
[exp_year] => 2025
[fingerprint] => EJUqgq2clF6JUp8f
[funding] => credit
[last4] => 4242
[metadata] => StripeAttachedObject Object
(
[_opts:protected] => StripeUtilRequestOptions Object
(
[headers] => Array
(
)
[apiKey] => sk_test_UsVZ1TRkIExFae3jiWUHvb2r
)
[_values:protected] => Array
(
)
[_unsavedValues:protected] => StripeUtilSet Object
(
[_elts:StripeUtilSet:private] => Array
(
)
)
[_transientValues:protected] => StripeUtilSet Object
(
[_elts:StripeUtilSet:private] => Array
(
)
)
[_retrieveOptions:protected] => Array
(
)
[_lastResponse:protected] => 
)
[name] => 
[tokenization_method] => 
)
[_unsavedValues:protected] => StripeUtilSet Object
(
[_elts:StripeUtilSet:private] => Array
(
)
)
[_transientValues:protected] => StripeUtilSet Object
(
[_elts:StripeUtilSet:private] => Array
(
)
)
[_retrieveOptions:protected] => Array
(
)
[_lastResponse:protected] => 
)
[source_transfer] => 
[statement_descriptor] => 
[status] => succeeded
[transfer_group] => 
)
[_unsavedValues:protected] => StripeUtilSet Object
(
[_elts:StripeUtilSet:private] => Array
(
)
)
[_transientValues:protected] => StripeUtilSet Object
(
[_elts:StripeUtilSet:private] => Array
(
)
)
[_retrieveOptions:protected] => Array
(
)
[_lastResponse:protected] => StripeApiResponse Object
(
[headers] => Array
(
[Server] => nginx
[Date] => Sat, 01 Apr 2017 10:25:47 GMT
[Content-Type] => application/json
[Content-Length] => 1926
[Connection] => keep-alive
[Access-Control-Allow-Credentials] => true
[Access-Control-Allow-Methods] => GET, POST, HEAD, OPTIONS, DELETE
[Access-Control-Allow-Origin] => *
[Access-Control-Max-Age] => 300
[Cache-Control] => no-cache, no-store
[Request-Id] => req_AOWT4rpoHd0H0A
[Stripe-Version] => 2017-02-14
[Strict-Transport-Security] => max-age=31556926; includeSubDomains
)
[body] => {

"id": "ch_1A3jQVG5CbtVORSys2Ho0vYD", "对象": "收费", "金额":5600, "amount_refunded": 0, "应用程序":空, "application_fee":空, "balance_transaction": "txn_1A3jQVG5CbtVORSyduH3NX76", "捕获":真实, "创建":1491042347, "货币": "美元", "客户":空, "描述": "你好世界", "目的地":空, "争议":空, "failure_code":空, "failure_message":空, "fraud_details": {}, "发票":空, "实时模式":假, "元数据":{ "名称": "卡蒂克", "exp_month": "03", "exp_year": "25", "address_zip": "1745236", "address_line1": "帕兰普尔", "电话": "8956235689", "CVV": "123" }, "on_behalf_of":空, "订单":空, "结果":{ "network_status": "approved_by_network", "原因":空, "risk_level": "正常", "seller_message": "付款完成"。 "类型":"已授权" }, "付费":真, "receipt_email":空, "receipt_number":空, "退款":假, "退款":{ "对象": "列表", "数据":[], "has_more":假, "total_count": 0, "网址": "/v1/收费/ch_1A3jQVG5CbtVORSys2Ho0vYD/退款" }, "审查":空, "运输":空, "源":{ "id": "card_1A3jQSG5CbtVORSysMV7SyBs", "对象": "卡", "address_city":空, "address_country":空, "address_line1":空, "address_line1_check":空, "address_line2":空, "address_state":空, "address_zip":空, "address_zip_check":空, "品牌": "签证", "国家": "美国", "客户":空, "cvc_check": "通过", "dynamic_last4":空, "exp_month": 3, 《exp_year》:2025年, "指纹": "EJUqgq2clF6JUp8f", "资金": "信贷", "last4": "4242", "元数据":{}, "名称":空, "tokenization_method":空 }, "source_transfer":空, "statement_descriptor":空, "状态": "成功", "transfer_group":空 }

[json] => Array
(
[id] => ch_1A3jQVG5CbtVORSys2Ho0vYD
[object] => charge
[amount] => 5600
[amount_refunded] => 0
[application] => 
[application_fee] => 
[balance_transaction] => txn_1A3jQVG5CbtVORSyduH3NX76
[captured] => 1
[created] => 1491042347
[currency] => usd
[customer] => 
[description] => hello world
[destination] => 
[dispute] => 
[failure_code] => 
[failure_message] => 
[fraud_details] => Array
(
)
[invoice] => 
[livemode] => 
[metadata] => Array
(
[name] => kartik
[exp_month] => 03
[exp_year] => 25
[address_zip] => 1745236
[address_line1] => palampur
[phone] => 8956235689
[cvv] => 123
)
[on_behalf_of] => 
[order] => 
[outcome] => Array
(
[network_status] => approved_by_network
[reason] => 
[risk_level] => normal
[seller_message] => Payment complete.
[type] => authorized
)
[paid] => 1
[receipt_email] => 
[receipt_number] => 
[refunded] => 
[refunds] => Array
(
[object] => list
[data] => Array
(
)
[has_more] => 
[total_count] => 0
[url] => /v1/charges/ch_1A3jQVG5CbtVORSys2Ho0vYD/refunds
)
[review] => 
[shipping] => 
[source] => Array
(
[id] => card_1A3jQSG5CbtVORSysMV7SyBs
[object] => card
[address_city] => 
[address_country] => 
[address_line1] => 
[address_line1_check] => 
[address_line2] => 
[address_state] => 
[address_zip] => 
[address_zip_check] => 
[brand] => Visa
[country] => US
[customer] => 
[cvc_check] => pass
[dynamic_last4] => 
[exp_month] => 3
[exp_year] => 2025
[fingerprint] => EJUqgq2clF6JUp8f
[funding] => credit
[last4] => 4242
[metadata] => Array
(
)
[name] => 
[tokenization_method] => 
)
[source_transfer] => 
[statement_descriptor] => 
[status] => succeeded
[transfer_group] => 
)
[code] => 200
)

) 这里

我遇到了同样的问题。从 PHP 返回的应该是:

回声(json_encode(可变));

这将为您提供可以使用的结果

最新更新