Problems with Applicationcharge

Highlighted
Excursionist
26 1 0

Hi, 

I have implement billing model like in this guide . The response is : 

 

string(439) "{"application_charge":{"id":806060080,"name":"App charge","api_client_id":2986379,"price":"100.00","status":"active","return_url":"https:\/\/98296194.ngrok.io\/code\/myfirstphpbackend\/tutorial_5\/billing","test":true,"created_at":"2019-07-22T06:09:51-04:00","updated_at":"2019-07-22T06:09:58-04:00","charge_type":null,"decorated_return_url":"https:\/\/98296194.ngrok.io\/code\/myfirstphpbackend\/tutorial_5\/billing?charge_id=806060080"}}"

But when I try to GET /admin/api/2019-07/application_charges/806060080.json It give back nothing. The access token I use it the same as above. The response

string(4218) "HTTP/2 200 
date: Mon, 22 Jul 2019 10:10:00 GMT
content-type: text/html; charset=utf-8
set-cookie: __cfduid=de1d77d4b0291b5ff1594a9f8df4f70581563790200; expires=Tue, 21-Jul-20 10:10:00 GMT; path=/; domain=.myshopify.com; HttpOnly
x-sorting-hat-podid: 47
x-sorting-hat-shopid: 15636398128
vary: Accept-Encoding
referrer-policy: origin-when-cross-origin
x-frame-options: DENY
x-shopid: 15636398128
x-shardid: 47
cache-control: no-cache, no-store
x-shopify-login-required: true
shopify-auth-mechanisms: password
strict-transport-security: max-age=7889238
set-cookie: _master_udr=eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJaWxoTkRJNU1UQXpNQzFoWkdRekxUUXdNakl0T1dWaU1DMDNZMkV5T1RSa09USXhaV1FHT2daRlJnPT0iLCJleHAiOiIyMDIxLTA3LTIyVDEwOjEwOjAwLjY5MFoiLCJwdXIiOiJjb29raWUuX21hc3Rlcl91ZHIifX0%3D--55181d25624e4439745de7750f2803cb5d1d4f18; domain=.myshopify.com; path=/admin; expires=Thu, 22 Jul 2021 10:10:00 -0000; secure; HttpOnly
x-shopify-stage: production
content-security-policy: default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://js-agent.newrelic.com https://bam.nr-data.net https://v.shopify.com 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=login&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fauth&source%5Bsection%5D=admin&source%5Buuid%5D=990841eb-3fd3-4de7-b470-3c9d16a9f21b
x-content-type-options: nosniff
x-download-options: noopen
x-permitted-cross-domain-policies: none
x-xss-protection: 1; mode=block; report=/xss-report?source%5Baction%5D=login&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fauth&source%5Bsection%5D=admin&source%5Buuid%5D=990841eb-3fd3-4de7-b470-3c9d16a9f21b
x-dc: gcp-us-east1,gcp-us-central1,gcp-us-central1
nel: {"report_to":"network-errors","max_age":2592000,"failure_fraction":0.01,"success_fraction":0.0001}
report-to: {"group":"network-errors","max_age":2592000,"endpoints":[{"url":"https://monorail-edge.shopifycloud.com/v1/reports/nel/20190325/shopify"}]}
x-request-id: 990841eb-3fd3-4de7-b470-3c9d16a9f21b
set-cookie: _orig_referrer=; Expires=Mon, 05-Aug-19 10:10:00 GMT; Path=/; HttpOnly
set-cookie: _secure_admin_session_id=b10c529ee02c5a0dacb58fe44c27cb61; path=/admin; expires=Tue, 22 Oct 2019 10:10:00 -0000; secure; HttpOnly
set-cookie: _landing_page=%2Fadmin%2Fauth%2Flogin; Expires=Mon, 05-Aug-19 10:10:00 GMT; Path=/; HttpOnly
nel: {"report_to":"network-errors","max_age":2592000,"failure_fraction":0.01,"success_fraction":0.0001}
report-to: {"group":"network-errors","max_age":2592000,"endpoints":[{"url":"https://monorail-edge.shopifycloud.com/v1/reports/nel/20190325/shopify"}]}
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
server: cloudflare
cf-ray: 4fa49f514e55d1bf-HKG

So how can I get the status I have try both  GET /admin/api/2019-07/application_charges.json and GET /admin/api/2019-07/application_charges/id.json

 

0 Likes
Shopify Partner
724 63 95

Are you sure you are sending the correct value for content-type header in your request. The enpoints oddly enough replies back to you with content-type: text/html.

Sergiu Svinarciuc | CTO @ visely.io
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
- To learn more about the awesome stuff we do head over to visely.io or our blog
0 Likes