WeChat Pay website integration using Postman with no programming skills - Please Help!

#1

Hi there,

I am in the process of integrating WeChat Pay (via Stripe) into my online shop (Wordpress). I have absolutely zero coding experience and asked Stripe support for some guidance.

I was advised to use Postman to make integration easier and was given some links to reading material. I have read through the documents but I still find it really confusing and hard to understand what it is I need to do, in what order and how. Also, I am completely unfamiliar with Postman, I have been looking at some tutorials on youtube to familiarise myself with the program.

Please see below the guidance I was given by Stripe support:

Run an API request to create a WeChat Pay source [1, & 2] using your test API keys [3]. In the creation response, we’ll include a link in the source[wechat][qr_code_url] attribute that you can follow to either authorize or decline the test payment. Once you’ve done that, the source object’s status will transition from “pending” to “chargeable” [4] and you can then create a charge using the source object’s ID number for the source argument that’s passed when creating a charge [5, & 6]. The easiest way to do this without any coding would be to send this request using a program like Postman [7].

[0] https:// docs . woocommerce . c o m / document / stripe / #section-8
[1] https:// stripe . c o m / docs / sources / wechat-pay#create-source
[2] https:// stripe. c o m / docs / api /sources / create
[3] https:// stripe . c o m / docs / keys
[4] https:// stripe . c o m / docs / sources / wechat-pay#charge-request
[5] https:// stripe . c o m / docs / sources / wechat-pay#make-a-charge-request-using-the-source
[6] https:// stripe . c o m / docs / api / charges / create#create_charge-source
[7] https:// www . getpostman . c o m /

I appreciate any help anyone would be willing to offer as I am facing a huge learning curve.

Many thanks in advance

1 Like

#2

Hi @postkitty and welcome. The learning curve is not bad when it comes to Postman, the curve is probably more on the side of API’s but once you get the hang of both you will be a wiz in no time.
Personally I have never worked with the Stripe API but I am happy to get you started and we can build from there as needed.

So it seem that the instructions are not overly clear if you are new to API’s but makes sense once you start to dig in. I have mapped out the first call for you here but you would need to fill in some blanks.

So in Postman, you can try importing the following call. Click the ‘Import’ button on the top and select the ‘Paste Raw Text’ tab, then past the call in there and hit ‘Import’.

curl -X GET \
  'https://api.stripe.com/v1/sources?type=wechat&amount=1099&currency=cad&statement_descriptor=myTest' \
  -H 'Authorization: Basic bXlVc2VybmFtZTo=' \
  -H 'cache-control: no-cache'

You should now see the call open in a tab within Postman. Next you are going to need to update a few things to make this work for you, providing you know this information.

Update any of these values to something you would like, for a simple test the current values should be fine I believe.

The next part is going to be the key to your success. Based on their documentation …

Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username value. You do not need to provide a password.

If you know your API Key you would insert it in the Username field like I have below. If you dont, you will need to follow their documentation and create one.

After you have done these steps. You should be able to successfully make the call by pressing the ‘Send’ button on the upper right hand corner of the application.
If it was successful, you sould see a status of 200 OK and there would be something in the ‘Body’ of the response. It would look something like this …

{
  "id": "src_18eYalAHEMiOZZp1l9ZTjSU0",
  "object": "source",
  "amount": 1099,
  "client_secret": "src_client_secret_UfwvW2WHpZ0s3QEn9g5x7waU",
  "created": 1445277809,
  "currency": "usd",
  "flow": "none",
  "livemode": true,
  "metadata": {},
  "owner": {
    "address": null,
    "email": null,
    "name": "null",
    "phone": null,
    "verified_address": null,
    "verified_email": null,
    "verified_name": null,
    "verified_phone": null
  },
  "status": "pending",
  "type": "wechat",
  "usage": "single_use",
  "wechat": {
    "qr_code_url": "weixin://wxpay/bizpayurl?pr=RaXzhu4",
  }
}

Once you have that, you can start building upon this. Stripe has some great documentation that can be found here https://stripe.com/docs/api
Feel free to reply here or PM me if you need any more help or clarification. I will try to respond as quickly as possible.

2 Likes

#3

Hi there! You can try doing this using Integromat, it allows you to connect to an API using any authentication method over HTTP. Moreover, there are some inbuilt endpoints for Stripe and WordPress which you might find helpful.

1 Like

#4

Hi tmccann, thank you so much for your response. Apologies for the late reply, things have been hectic on my end and have only just got some free time on my hands to work on this.

I pasted the call and was able to import and can see the parameters (keys and values) except for the descriptions. I added the same descriptions as in your screenshot. And then in the authorization tab, I selected ‘Basic Auth’ and then put my test API key in the username field (left password blank) and pressed the send button. I received an error message. Not sure where I am going wrong.

I appreciate any feedback you may have.

Many thanks,

P.K

0 Likes

#5

Hi arpit, thanks for making the suggestion about Integromat, I had a quick look at it and am intrigued to learn more about its capabilities.

Many thanks,

P.K

0 Likes

#6

@postkitty What was the error message you received?

0 Likes

#7

Hi guys,

I have the same problem and I need to fix it. The Stripe “support” gave me no support at all: they just told to ask a developer. Nice!

I tried your directions, I used the publishable test API key, I also made a new call but I get the same error, even if I copy and paste the URL on a browser. Well, actually, when I tried that, it asked me for username and password first, I guessed I had to use the same API key… and got the same error.
What can I do?
Thanks

Suddenly, it worked! And I have the response now, but, now I don’t know what to do…
Actually, it worked with POST and not GET.
Now, the source is chargeable but I don’t understand how to do it.
Any help to continue?

I got “Source is chargeable” after going to the URL indicated as QRcode and authorizing the payment.

Updates below

0 Likes

#8

I have some updates: after the source, I made the charge, always on Postman and the transaction went OK, I can see it in my test dashboard.

The problem is that nothing changed: inside the payment settings, WeChat is still pending and I still don’t know what I have to do next on my WordPress.

Then, with WeChat you should pay through scanning a QRcode in your app, but, no QRcode here.

0 Likes

#9

I am not familiar with WeChat itself so I am probably not much help there but if you can give me some idea on the calls you are doing or the process I may be able to help with some direction.

0 Likes

#10

I hope this can help.
This was the first call for the source made on Postman: https://api.stripe.com/v1/sources?type=wechat&amount=1099&currency=eur

And this was the call for the charge: https://api.stripe.com/v1/charges?amount=1099&currency=eur&source=(src… taken from the previous call)

If you can do the process you can see the responses. I used POST not GET (as shown in your picture).
I tried 3/4 times and went OK, transaction completed. From Stripe support, they told me that it takes 1 to 4 days to change from Pending to Live.
But, when it’s live, how can I put all this stuff on my website? (wordpress org)

WeChat Pay actually is quite easy, it’s like WhatsApp with a wallet. You scan a QRcode and you pay.
There’s a plugin for WooCommerce, but unless you have your official international WeChat QRcode issued by the App (read Chinese Gov) that takes up to 1 month or more, you can’t use it.
It seems that with Stripe is different, they issue a specific QRcode every payment, I don’t know, I didn’t get it. Their page about this method of payment doesn’t tell me much. I followed their steps, I made it, maybe if a few days it will go Live, but still, I don’t know how I integrate it in my website that is still under construction.

Many thanks for the time and the help, if you can.

0 Likes

#11

ok I don’t even know how, but I’ve been able to activate the Wechat payment method using Postman. Now is activated and I can work with it, but HOW in the world do I transform all this weird stuff into a button so people can buy things??

0 Likes