Skip to content

Commit 941f9e6

Browse files
authored
Merge pull request #388 from bakaphp/refact-payment-intent
refactor payment intent
2 parents 02104e9 + 5649f85 commit 941f9e6

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.28.3",
2+
"version": "0.28.4",
33
"license": "MIT",
44
"main": "dist/index.js",
55
"typings": "dist/index.d.ts",

src/modules/commerce/orders/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,17 @@ export class Order {
5151
}
5252

5353
public async generatePaymentIntent(
54-
id: string
54+
amount: number
5555
): Promise<GeneratePaymentIntentResult> {
5656
const response = await this.client.mutate({
5757
mutation: GENERATE_ORDER_PAYMENT_INTENT_MUTATION,
58-
variables: { id },
58+
variables: { amount },
5959
});
6060

6161
return response.data
6262
.generateOrderPaymentIntent as GeneratePaymentIntentResult;
6363
}
64+
6465
public async getOrders(
6566
options: {
6667
first?: number;

src/mutations/commerce.mutation.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ export const CREATE_ORDER_FROM_APPLE_IN_APP_PURCHASE = gql`
6767
`;
6868

6969
export const GENERATE_ORDER_PAYMENT_INTENT_MUTATION = gql`
70-
mutation($id: ID!) {
71-
generateOrderPaymentIntent(id: $id) {
70+
mutation($amount: Money!) {
71+
generateOrderPaymentIntent(amount: $amount) {
7272
client_secret
7373
status
7474
message

0 commit comments

Comments
 (0)