php - PayPal Rest API - Live payments fail, sandbox works -
i've built job listing website can pay publish own job listings. working expected, job searching functionality , user registration/profile system. it's live , looks great!
but we've switched paypal on live credentials, payment not working. working sandbox... have followed rest api closely possible, allowing optional fields , requiring required ones, sending proper type formats (integer, strings , objects) defined in api documentation...
still, attempts payment gets notification of "credit card refused". i have contacted paypal , have been through back-and-forth trying resolve issue, persist issue not on end.
i'm going include debugging information below in email paypal well, maybe here has more experience type of issue , can me out.
here json code submitted using my own personal credit card (sensitive info removed, of course):
{"intent":"sale","payer":{"payment_method":"credit_card","funding_instruments":[{"credit_card":{"number":"**hidden**","type":"mastercard","expire_month":10,"expire_year":2016,"cvv2":"**hidden**","first_name":"radley","last_name":"sustaire","billing_address":{"line1":"**removed**","city":"veneta","postal_code":"97487","country_code":"us","state":"or"}}}]},"transactions":[{"amount":{"total":"1.00","currency":"usd"},"description":"purchased product: 30-day free job listing"}]} and here result received paypal, curl (in object layout):
submitted information (cc details masked): array(3) { ["intent"]=> string(4) "sale" ["payer"]=> array(2) { ["payment_method"]=> string(11) "credit_card" ["funding_instruments"]=> array(1) { [0]=> array(1) { ["credit_card"]=> array(8) { ["number"]=> string(10) "**removed**" ["type"]=> string(10) "mastercard" ["expire_month"]=> int(10) ["expire_year"]=> int(2016) ["cvv2"]=> string(10) "**removed**" ["first_name"]=> string(6) "radley" ["last_name"]=> string(8) "sustaire" ["billing_address"]=> array(5) { ["line1"]=> string(15) "**removed**" ["city"]=> string(6) "veneta" ["postal_code"]=> string(5) "97487" ["country_code"]=> string(2) "us" ["state"]=> string(2) "or" } } } } } ["transactions"]=> array(1) { [0]=> array(2) { ["amount"]=> array(2) { ["total"]=> string(4) "1.00" ["currency"]=> string(3) "usd" } ["description"]=> string(42) "purchased product: 30-day free job listing" } } } --- submitted information (json): string(482) "{"intent":"sale","payer":{"payment_method":"credit_card","funding_instruments":[{"credit_card":{"number":"**removed**","type":"mastercard","expire_month":10,"expire_year":2016,"cvv2":"**removed**","first_name":"radley","last_name":"sustaire","billing_address":{"line1":"**removed**","city":"veneta","postal_code":"97487","country_code":"us","state":"or"}}}]},"transactions":[{"amount":{"total":"1.00","currency":"usd"},"description":"purchased product: 30-day free job listing"}]}" --- curl headers: array(6) { ["curlopt_post"]=> bool(true) ["curlopt_ssl_verifypeer"]=> bool(false) ["curlopt_header"]=> bool(false) ["curlopt_returntransfer"]=> bool(true) ["curlopt_httpheader"]=> array(3) { [0]=> string(65) "authorization: bearer **removed**" [1]=> string(24) "accept: application/json" [2]=> string(30) "content-type: application/json" } ["curlopt_postfields"]=> array(1) { [0]=> string(484) "{"intent":"sale","payer":{"payment_method":"credit_card","funding_instruments":[{"credit_card":{"number":"**removed**","type":"mastercard","expire_month":10,"expire_year":2016,"cvv2":"**removed**","first_name":"radley","last_name":"sustaire","billing_address":{"line1":"**removed**","city":"veneta","postal_code":"97487","country_code":"us","state":"or"}}}]},"transactions":[{"amount":{"total":"1.00","currency":"usd"},"description":"purchased product: 30-day free job listing"}]}" } } --- paypal response (raw): string(191) "{"name":"credit_card_refused","message":"credit card refused","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#credit_card_refused","debug_id":"ab5d7c220fd22"}" --- paypal response (object): object(stdclass)#385 (4) { ["name"]=> string(19) "credit_card_refused" ["message"]=> string(23) "credit card refused" ["information_link"]=> string(76) "https://developer.paypal.com/webapps/developer/docs/api/#credit_card_refused" ["debug_id"]=> string(13) "ab5d7c220fd22" } --- http info: array(23) { ["url"]=> string(42) "https://api.paypal.com/v1/payments/payment" ["content_type"]=> string(16) "application/json" ["http_code"]=> int(400) ["header_size"]=> int(495) ["request_size"]=> int(687) ["filetime"]=> int(-1) ["ssl_verify_result"]=> int(0) ["redirect_count"]=> int(0) ["total_time"]=> float(5.217304) ["namelookup_time"]=> float(2.1e-5) ["connect_time"]=> float(0.088343) ["pretransfer_time"]=> float(0.367546) ["size_upload"]=> float(481) ["size_download"]=> float(191) ["speed_download"]=> float(36) ["speed_upload"]=> float(92) ["download_content_length"]=> float(-1) ["upload_content_length"]=> float(0) ["starttransfer_time"]=> float(5.216257) ["redirect_time"]=> float(0) ["certinfo"]=> array(0) { } ["primary_ip"]=> string(11) "**removed*" ["redirect_url"]=> string(0) "" } --- curl error #: int(0)
after looking @ logs specific debug_id, showing standard payment decline. it's not integration issue. if need more specific information, you'll need contact customer support , have them payment attempts card used.
Comments
Post a Comment