-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathcodeSnippets.json
194 lines (194 loc) · 56.2 KB
/
codeSnippets.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
{
"codeSnippet": {
"installation": {
"python": "# If you love Python, you will love our pip installation package, \n # simply run the following to ensure you have all the methods needed to make the integration\n $ pip install paypayopa",
"php": "## Minimum required software requirements\n # To use the Paypay OPA PHP SDK you need:\n\n # A server compute environment (local machines, docker containers, VPS or dedicated servers, cloud infrastructure etc. )\n # A web server to serve your API responses and html documents.\n # PHP version 7.x interpreter to execute your backend code.\n # Composer to manage your dependencies(recommended) or a release version from this repo to manually maintain your dependencies.\n \n #To install the bindings via Composer, add the following to composer.json:\n composer require paypayopa/php-sdk",
"node": "// To install the client library using npm, execute the following\n npm i @paypayopa/paypayopa-sdk-node\n // To install the client library using yarn, execute the following\n yarn add @paypayopa/paypayopa-sdk-node",
"java": "<!-- To install the API client library to your local Maven repository, simply execute: -->\n gradle install\n <!-- Maven: Add this dependency to your project's POM: -->\n <dependency>\n <groupId>jp.ne.paypay</groupId>\n <artifactId>paypayopa</artifactId>\n <version>1.0.1</version>\n <scope>compile</scope>\n </dependency>\n <!-- Gradle: Add this dependency to your project's build file: -->\n compile \"jp.ne.paypay:paypayopa:1.0.1\""
},
"setupKeys": {
"python": "import paypayopa\n ''' production_mode : Set the connection destination of the sandbox environment / production environment. \n The default false setting connects to the sandbox environment. The True setting connects to the production environment. '''\n client = paypayopa.Client(auth=(API_KEY, API_SECRET), production_mode=False)\n client.set_assume_merchant(\"MERCHANT_ID\")",
"php": "use PayPay\\OpenPaymentAPI\\Client;\n\n $client = new Client([\n 'API_KEY' => 'YOUR_API_KEY',\n 'API_SECRET'=>'YOUR_API_SECRET',\n 'MERCHANT_ID'=>'YOUR_MERCHANT_ID' \n ],false); /* production_mode : Set the connection destination of the sandbox environment / production environment. \n The default false setting connects to the sandbox environment. The True setting connects to the production environment. */",
"node": "use strict';\n const PAYPAY = require('@paypayopa/paypayopa-sdk-node');\n PAYPAY.Configure({\n clientId: API_KEY,\n clientSecret: API_SECRET,\n merchantId: MERCHANT_ID,\n /* production_mode : Set the connection destination of the sandbox environment / production environment. \n The default false setting connects to the sandbox environment. The True setting connects to the production environment. */ \n productionMode: false, \n });",
"java": "ApiClient apiClient = new Configuration().getDefaultApiClient();\n /* production_mode : Set the connection destination of the sandbox environment / production environment. \n The default false setting connects to the sandbox environment. The True setting connects to the production environment. */ \n apiClient.setProductionMode(false); \n apiClient.setApiKey(\"YOUR_API_KEY\");\n apiClient.setApiSecretKey(\"YOUR_API_SECRET\");\n apiClient.setAssumeMerchant(\"YOUR_MERCHANT_KEY\");"
},
"dynamicQrCode": {
"dynamic": {
"python": "# Creating the payload to create a QR Code, additional parameters can be added basis the API Documentation\n request = {\n \"merchantPaymentId\": \"merchant_payment_id\",\n \"codeType\": \"ORDER_QR\",\n \"redirectUrl\": \"http://foobar.com\",\n \"redirectType\":\"WEB_LINK\",\n \"orderDescription\":\"Example - Mune Cake shop\",\n \"orderItems\": [{\n \"name\": \"Moon cake\",\n \"category\": \"pasteries\",\n \"quantity\": 1,\n \"productId\": \"67678\",\n \"unitPrice\": {\n \"amount\": 1,\n \"currency\": \"JPY\"\n }\n }],\n \"amount\": {\n \"amount\": 1,\n \"currency\": \"JPY\"\n },\n}\n# Calling the method to create a qr code\nresponse = client.Code.create_qr_code(request)\n# Printing if the method call was SUCCESS\nprint(response['resultInfo']['code'])",
"php": "use PayPay\\OpenPaymentAPI\\Models\\CreateQrCodePayload;\nuse PayPay\\OpenPaymentAPI\\Models\\OrderItem;\n/*\n.....initialize SDK\n*/\n// setup payment object\n$CQCPayload = new CreateQrCodePayload();\n\n// Set merchant pay identifier\n$CQCPayload->setMerchantPaymentId(\"YOUR_TRANSACTION_ID\");\n\n// Log time of request\n$CQCPayload->setRequestedAt();\n// Indicate you want QR Code\n$CQCPayload->setCodeType(\"ORDER_QR\");\n\n// Provide order details for invoicing\n$OrderItems = [];\n$OrderItems[] = (new OrderItem())\n ->setName('Cake')\n ->setQuantity(1)\n ->setUnitPrice('amount' => 20, 'currency' => 'JPY']);\n$CQCPayload->setOrderItems($OrderItems);\n\n// Save Cart totals\n$amount = [\n \"amount\" => 1,\n \"currency\" => \"JPY\"\n];\n$CQCPayload->setAmount($amount);\n// Configure redirects\n$CQCPayload->setRedirectType('WEB_LINK');\n$CQCPayload->setRedirectUrl($_SERVER['SERVER_NAME']);\n\n// Get data for QR code\n$response = $client->code->createQRCode($CQCPayload);\n\n$data = $response['data'];",
"node": "// Creating the payload to create a QR Code, additional parameters can be added basis the API Documentation\n'use strict';\nlet payload = {\n merchantPaymentId: \"my_payment_id\",\n amount: {\n amount: 1,\n currency: \"JPY\"\n },\n codeType: \"ORDER_QR\",\n orderDescription: \"Mune's Favourite Cake\",\n isAuthorization: false\n };\n// Calling the method to create a qr code\nPAYPAY.QRCodeCreate(payload, (response) => {\n// Printing if the method call was SUCCESS\nconsole.log(response.BODY.resultInfo.code);\n });",
"java": "// Creating the payload to create a QR Code, additional parameters can be added basis the API Documentation\nQRCode qrCode = new QRCode();\n qrCode.setAmount(new MoneyAmount().amount(10).currency(MoneyAmount.CurrencyEnum.JPY));\n qrCode.setMerchantPaymentId(\"my_payment_id\");\n qrCode.setCodeType(\"ORDER_QR\");\n qrCode.setOrderDescription(\"Mune's Favourite Cake\");\n qrCode.isAuthorization(false);\n \n// Calling the method to create a qr code\nPaymentApi apiInstance = new PaymentApi(apiClient);\nQRCodeDetails response = apiInstance.createQRCode(qrCode);\n// Printing if the method call was SUCCESS\nSystem.out.println(response.getResultInfo().getCode());"
},
"appInvoke": {
"python": "# Creating the payload to create a QR Code, additional parameters can be added basis the API Documentation\n request = {\n \"merchantPaymentId\": \"merchant_payment_id\",\n \"codeType\": \"ORDER_QR\",\n \"redirectUrl\": \"http://foobar.com\",\n \"redirectType\":\"WEB_LINK\",\n \"orderDescription\":\"Example - Mune Cake shop\",\n \"orderItems\": [{\n \"name\": \"Moon cake\",\n \"category\": \"pasteries\",\n \"quantity\": 1,\n \"productId\": \"67678\",\n \"unitPrice\": {\n \"amount\": 1,\n \"currency\": \"JPY\"\n }\n }],\n \"amount\": {\n \"amount\": 1,\n \"currency\": \"JPY\"\n },\n}\n# Calling the method to create a qr code\nresponse = client.Code.create_qr_code(request)\n# Printing if the method call was SUCCESS\nprint(response['resultInfo']['code'])",
"php": "use PayPay\\OpenPaymentAPI\\Models\\CreateQrCodePayload;\n use PayPay\\OpenPaymentAPI\\Models\\OrderItem;\n /*\n .....initialize SDK\n */\n // setup payment object\n $CQCPayload = new CreateQrCodePayload();\n \n // Set merchant pay identifier\n $CQCPayload->setMerchantPaymentId(\"YOUR_TRANSACTION_ID\");\n \n // Log time of request\n $CQCPayload->setRequestedAt();\n // Indicate you want QR Code\n $CQCPayload->setCodeType(\"ORDER_QR\");\n \n // Provide order details for invoicing\n $OrderItems = [];\n $OrderItems[] = (new OrderItem())\n ->setName('Cake')\n ->setQuantity(1)\n ->setUnitPrice('amount' => 20, 'currency' => 'JPY']);\n $CQCPayload->setOrderItems($OrderItems);\n \n // Save Cart totals\n $amount = [\n \"amount\" => 1,\n \"currency\" => \"JPY\"\n ];\n $CQCPayload->setAmount($amount);\n // Configure redirects\n $CQCPayload->setRedirectType('WEB_LINK');\n $CQCPayload->setRedirectUrl($_SERVER['SERVER_NAME']);\n \n // Get data for QR code\n $response = $client->code->createQRCode($CQCPayload);\n\n $data = $response['data'];",
"node": "// Creating the payload to create a QR Code, additional parameters can be added basis the API Documentation\n 'use strict';\n let payload = {\n merchantPaymentId: \"my_payment_id\",\n amount: {\n amount: 1,\n currency: \"JPY\"\n },\n codeType: \"ORDER_QR\",\n orderDescription: \"Mune's Favourite Cake\",\n isAuthorization: false,\n redirectUrl: \"https://paypay.ne.jp/\",\n redirectType: \"WEB_LINK\",\n userAgent: \"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1\"\n };\n // Calling the method to create a qr code\n PAYPAY.QRCodeCreate(payload, (response) => {\n // Printing if the method call was SUCCESS\n console.log(response.BODY.resultInfo.code);\n });\n",
"java": "// Creating the payload to create a QR Code, additional parameters can be added basis the API Documentation\n QRCode qrCode = new QRCode();\n qrCode.setAmount(new MoneyAmount().amount(10).currency(MoneyAmount.CurrencyEnum.JPY));\n qrCode.setMerchantPaymentId(\"my_payment_id\");\n qrCode.setCodeType(\"ORDER_QR\");\n qrCode.setOrderDescription(\"Mune's Favourite Cake\");\n qrCode.isAuthorization(false);\n qrCode.setRedirectUrl(\"https://paypay.ne.jp/\");\n //For Deep Link, RedirectTypeEnum.APP_DEEP_LINK\n qrCode.setRedirectType(QRCode.RedirectTypeEnum.WEB_LINK);\n qrCode.setUserAgent(\"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1\");\n \n // Calling the method to create a qr code\n PaymentApi apiInstance = new PaymentApi(apiClient);\n QRCodeDetails response = apiInstance.createQRCode(qrCode);\n // Printing if the method call was SUCCESS\n System.out.println(response.getResultInfo().getCode());"
}
},
"accountLinkQrCode": {
"directDebit": {
"python": "payload = {\n \"scopes\": [\n \"direct_debit\"\n ],\n \"nonce\": \"rtyuhghj7989\",\n \"redirectType\": \"WEB_LINK\",\n \"redirectUrl\": \"https://merchant.domain\",\n \"referenceId\": \"uioiugf789\",\n \"phoneNumber\": \"90999999999\",\n \"deviceId\": \"qwertyuiopoiuytre54567\",\n \"userAgent\": \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36\"\n}\nclient.Account.create_qr_session(payload)",
"php": "/**\n* initialize SDK\n*/\nuse PayPay\\OpenPaymentAPI\\Models\\AccountLinkPayload;\n$payload = new AccountLinkPayload();\n $payload\n ->setScopes([\"direct_debit\"])\n ->setRedirectUrl(\"https://merchant.domain\")\n ->setReferenceId(uniqid(\"TEST123\"));\n$resp = $client->user->createAccountLinkQrCode($payload);",
"node": "'use strict';\nconst PAYPAY = require('@paypayopa/paypayopa-sdk-node');\nlet payload = {\nscopes: [\n\t\t\"direct_debit\"\n\t],\nnonce: \"random_generated_string\",\nredirectType: \"WEB_LINK\",\nredirectUrl: \"https://merchant.domain\",\nreferenceId: \"reference_id\",\nphoneNumber: \"phone_number\",\ndeviceId: \"device_id\"\n};\n// Calling the method to create the account linking QR Code\nPAYPAY.AccountLinkQRCodeCreate(payload, (response) => {\n// Printing if the method call was SUCCESS\nconsole.log(response.BODY.resultInfo.code);\n// Printing the link to the generated QR Code\nconsole.log(response.BODY.data.linkQRCodeURL);\n});",
"java": "PaymentApi apiInstance = new PaymentApi(apiClient);\nAccountLinkQRCode accountLinkQRCode = new AccountLinkQRCode();\nList<AuthorizationScope> scopes = new ArrayList<>();\n\tscopes.add(AuthorizationScope.DIRECT_DEBIT);\n\taccountLinkQRCode.setScopes(scopes);\n\taccountLinkQRCode.setNonce(RandomStringUtils.randomAlphanumeric(8).toLowerCase());\n\taccountLinkQRCode.setDeviceId(\"device_id\");\n\taccountLinkQRCode.setRedirectUrl(\"https://merchant.domain\");\n\taccountLinkQRCode.setPhoneNumber(\"phone_number\");\n\taccountLinkQRCode.setReferenceId(\"reference_id\");\n\taccountLinkQRCode.setRedirectType(QRCode.RedirectTypeEnum.WEB_LINK);\n\t\nLinkQRCodeResponse response = apiInstance.createAccountLinkQRCode(accountLinkQRCode);\n// Printing if the method call was SUCCESS\nSystem.out.println(response.getResultInfo().getCode());\n// Printing the link to the generated QR Code\nSystem.out.println(response.getData().getLinkQRCodeURL());"
},
"preAuth": {
"python": "payload = {\n \"scopes\": [\n \"preauth_capture_native\"\n ],\n \"nonce\": \"rtyuhghj7989\",\n \"redirectType\": \"WEB_LINK\",\n \"redirectUrl\": \"https://merchant.domain\",\n \"referenceId\": \"uioiugf789\",\n \"phoneNumber\": \"90999999999\",\n \"deviceId\": \"qwertyuiopoiuytre54567\",\n \"userAgent\": \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36\"\n}\nclient.Account.create_qr_session(payload)",
"php": "/**\n* initialize SDK\n*/\nuse PayPay\\OpenPaymentAPI\\Models\\AccountLinkPayload;\n$payload = new AccountLinkPayload();\n $payload\n ->setScopes([\"preauth_capture_native\"])\n ->setRedirectUrl(\"https://merchant.domain\")\n ->setReferenceId(uniqid(\"TEST123\"));\n$resp = $client->user->createAccountLinkQrCode($payload);",
"node": "'use strict';\nconst PAYPAY = require('@paypayopa/paypayopa-sdk-node');\nlet payload = {\nscopes: [\n\t\t\"preauth_capture_native\"\n\t],\nnonce: \"random_generated_string\",\nredirectType: \"WEB_LINK\",\nredirectUrl: \"https://merchant.domain\",\nreferenceId: \"reference_id\",\nphoneNumber: \"phone_number\",\ndeviceId: \"device_id\"\n};\n// Calling the method to create the account linking QR Code\nPAYPAY.AccountLinkQRCodeCreate(payload, (response) => {\n// Printing if the method call was SUCCESS\nconsole.log(response.BODY.resultInfo.code);\n// Printing the link to the generated QR Code\nconsole.log(response.BODY.data.linkQRCodeURL);\n});",
"java": "PaymentApi apiInstance = new PaymentApi(apiClient);\nAccountLinkQRCode accountLinkQRCode = new AccountLinkQRCode();\nList<AuthorizationScope> scopes = new ArrayList<>();\n\tscopes.add(AuthorizationScope.PREAUTH_CAPTURE_NATIVE);\n\taccountLinkQRCode.setScopes(scopes);\n\taccountLinkQRCode.setNonce(RandomStringUtils.randomAlphanumeric(8).toLowerCase());\n\taccountLinkQRCode.setDeviceId(\"device_id\");\n\taccountLinkQRCode.setRedirectUrl(\"https://merchant.domain\");\n\taccountLinkQRCode.setPhoneNumber(\"phone_number\");\n\taccountLinkQRCode.setReferenceId(\"reference_id\");\n\taccountLinkQRCode.setRedirectType(QRCode.RedirectTypeEnum.WEB_LINK);\n\t\nLinkQRCodeResponse response = apiInstance.createAccountLinkQRCode(accountLinkQRCode);\n// Printing if the method call was SUCCESS\nSystem.out.println(response.getResultInfo().getCode());\n// Printing the link to the generated QR Code\nSystem.out.println(response.getData().getLinkQRCodeURL());"
},
"continuousPayment": {
"python": "payload = {\n \"scopes\": [\n \"continuous_payments\"\n ],\n \"nonce\": \"rtyuhghj7989\",\n \"redirectType\": \"WEB_LINK\",\n \"redirectUrl\": \"https://merchant.domain\",\n \"referenceId\": \"uioiugf789\",\n \"phoneNumber\": \"90999999999\",\n \"deviceId\": \"qwertyuiopoiuytre54567\",\n \"userAgent\": \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36\"\n}\nclient.Account.create_qr_session(payload)",
"php": "/**\n* initialize SDK\n*/\nuse PayPay\\OpenPaymentAPI\\Models\\AccountLinkPayload;\n$payload = new AccountLinkPayload();\n $payload\n ->setScopes([\"continuous_payments\"])\n ->setRedirectUrl(\"https://merchant.domain\")\n ->setReferenceId(uniqid(\"TEST123\"));\n$resp = $client->user->createAccountLinkQrCode($payload);",
"node": "'use strict';\nconst PAYPAY = require('@paypayopa/paypayopa-sdk-node');\nlet payload = {\nscopes: [\n\t\t\"continuous_payments\"\n\t],\nnonce: \"random_generated_string\",\nredirectType: \"WEB_LINK\",\nredirectUrl: \"https://merchant.domain\",\nreferenceId: \"reference_id\",\nphoneNumber: \"phone_number\",\ndeviceId: \"device_id\"\n};\n// Calling the method to create the account linking QR Code\nPAYPAY.AccountLinkQRCodeCreate(payload, (response) => {\n// Printing if the method call was SUCCESS\nconsole.log(response.BODY.resultInfo.code);\n// Printing the link to the generated QR Code\nconsole.log(response.BODY.data.linkQRCodeURL);\n});",
"java": "PaymentApi apiInstance = new PaymentApi(apiClient);\nAccountLinkQRCode accountLinkQRCode = new AccountLinkQRCode();\nList<AuthorizationScope> scopes = new ArrayList<>();\n\tscopes.add(AuthorizationScope.CONTINUOUS_PAYMENTS);\n\taccountLinkQRCode.setScopes(scopes);\n\taccountLinkQRCode.setNonce(RandomStringUtils.randomAlphanumeric(8).toLowerCase());\n\taccountLinkQRCode.setDeviceId(\"device_id\");\n\taccountLinkQRCode.setRedirectUrl(\"https://merchant.domain\");\n\taccountLinkQRCode.setPhoneNumber(\"phone_number\");\n\taccountLinkQRCode.setReferenceId(\"reference_id\");\n\taccountLinkQRCode.setRedirectType(QRCode.RedirectTypeEnum.WEB_LINK);\n\t\nLinkQRCodeResponse response = apiInstance.createAccountLinkQRCode(accountLinkQRCode);\n// Printing if the method call was SUCCESS\nSystem.out.println(response.getResultInfo().getCode());\n// Printing the link to the generated QR Code\nSystem.out.println(response.getData().getLinkQRCodeURL());"
},
"pendingPayment": {
"python": "payload = {\n \"scopes\": [\n \"pending_payments\"\n ],\n \"nonce\": \"rtyuhghj7989\",\n \"redirectType\": \"WEB_LINK\",\n \"redirectUrl\": \"https://merchant.domain\",\n \"referenceId\": \"uioiugf789\",\n \"phoneNumber\": \"90999999999\",\n \"deviceId\": \"qwertyuiopoiuytre54567\",\n \"userAgent\": \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36\"\n}\nclient.Account.create_qr_session(payload)",
"php": "/**\n* initialize SDK\n*/\nuse PayPay\\OpenPaymentAPI\\Models\\AccountLinkPayload;\n$payload = new AccountLinkPayload();\n $payload\n ->setScopes([\"pending_payments\"])\n ->setRedirectUrl(\"https://merchant.domain\")\n ->setReferenceId(uniqid(\"TEST123\"));\n$resp = $client->user->createAccountLinkQrCode($payload);",
"node": "'use strict';\nconst PAYPAY = require('@paypayopa/paypayopa-sdk-node');\nlet payload = {\nscopes: [\n\t\t\"pending_payments\"\n\t],\nnonce: \"random_generated_string\",\nredirectType: \"WEB_LINK\",\nredirectUrl: \"https://merchant.domain\",\nreferenceId: \"reference_id\",\nphoneNumber: \"phone_number\",\ndeviceId: \"device_id\"\n};\n// Calling the method to create the account linking QR Code\nPAYPAY.AccountLinkQRCodeCreate(payload, (response) => {\n// Printing if the method call was SUCCESS\nconsole.log(response.BODY.resultInfo.code);\n// Printing the link to the generated QR Code\nconsole.log(response.BODY.data.linkQRCodeURL);\n});",
"java": "PaymentApi apiInstance = new PaymentApi(apiClient);\nAccountLinkQRCode accountLinkQRCode = new AccountLinkQRCode();\nList<AuthorizationScope> scopes = new ArrayList<>();\n\tscopes.add(AuthorizationScope.PENDING_PAYMENTS);\n\taccountLinkQRCode.setScopes(scopes);\n\taccountLinkQRCode.setNonce(RandomStringUtils.randomAlphanumeric(8).toLowerCase());\n\taccountLinkQRCode.setDeviceId(\"device_id\");\n\taccountLinkQRCode.setRedirectUrl(\"https://merchant.domain\");\n\taccountLinkQRCode.setPhoneNumber(\"phone_number\");\n\taccountLinkQRCode.setReferenceId(\"reference_id\");\n\taccountLinkQRCode.setRedirectType(QRCode.RedirectTypeEnum.WEB_LINK);\n\t\nLinkQRCodeResponse response = apiInstance.createAccountLinkQRCode(accountLinkQRCode);\n// Printing if the method call was SUCCESS\nSystem.out.println(response.getResultInfo().getCode());\n// Printing the link to the generated QR Code\nSystem.out.println(response.getData().getLinkQRCodeURL());"
}
},
"getUserAuthCode": {
"python":"# Retrieving userAuthorizationId from response JWT\nclient.decode_jwt(API_SECRET, token)",
"php": "/*\n .....initialize SDK\n */\n $token = $_GET['responseToken'];\n $authorization = $this->client->user->decodeUserAuth($token);\n /*\n ...fetch stored nonce for integrity check\n */\n $userAuthorizationId = false;\n if ($authorization['result']==='succeeded' && $authorization['nonce']===$fetchedNonce){\n $userAuthorizationId = $authorization['userAuthorizationId'] \n }",
"node": "const PAYPAY = require('../../dist');\n// Retrieving userAuthorizationId from response JWT\nconst jwtResponse = PAYPAY.ValidateJWT(token, API_SECRET);\nconst userAuthorizationId = jwtResponse[\"userAuthorizationId\"];",
"java": "// Retrieving userAuthorizationId from response JWT\n String jwtToken = \"JWT_TOKEN\";\n String apiSecretKey = \"YOUR_API_SECRET_KEY\";\n JwtResponseDto jwtResponseDto = JwtUtil.validateJWT(jwtToken, apiSecretKey);\n System.out.println(jwtResponseDto.getUserAuthorizationId());"
},
"createPayment": {
"default": {
"python":"# Creating the payload to create a Payment, additional parameters can be added basis the API Documentation\nrequest = {\n merchantPaymentId = \"my_payment_id\",\n userAuthorizationId = \"my_user_authorization_id\",\n amount = {\n amount = 1, \n currency = \"JPY\"\n },\n orderDescription = \"Mune's Favourite Cake\"\n}\n# Calling the method to create a payment\nresponse = client.Payment.create(request)\n# Printing if the method call was SUCCESS, this does not mean the payment was a success\nprint(response['resultInfo']['code'])",
"php": "use PayPay\\OpenPaymentAPI\\Models\\CreatePaymentPayload;\n// Creating the payload to create a Payment, additional parameters can be added basis the API Documentation\n$CPPayload = new CreatePaymentPayload();\n// Save Cart totals\n$amount = [\n \"amount\" => 1,\n \"currency\" => \"JPY\"\n];\n$CPPayload\n ->setMerchantPaymentId(uniqid('TESTMERCH_PAY_ID'))\n ->setRequestedAt()\n ->setUserAuthorizationId($this->config['uaid'])\n ->setAmount($amount);\n// Get data for QR code\n$response = $client->payment->createPayment($CPPayload);",
"node": "// Creating the payload to create a Payment, additional parameters can be added basis the API Documentation\n'use strict';\nlet payload = {\n merchantPaymentId: \"my_payment_id\",\n amount: {\n amount: 1,\n currency: \"JPY\"\n },\n requestedAt: 1587460334340,\n userAuthorizationId: \"my_user_authorization_id\",\n orderDescription: \"Mune's Favourite Cake\",\n};\n// Calling the method to create a qr code\nPAYPAY.CreatePayment(payload, (response) => {\n// Printing if the method call was SUCCESS\n console.log(response.BODY.resultInfo.code);\n});",
"java": "// Creating the payload to create a Payment, additional parameters can be added basis the API Documentation\nPayment payment = new Payment();\n payment.setAmount(new MoneyAmount().amount(10).currency(MoneyAmount.CurrencyEnum.JPY));\n payment.setMerchantPaymentId(\"my_payment_id\");\n payment.setUserAuthorizationId(\"my_user_authorization_id\");\n payment.setOrderDescription(\"Mune's Favourite Cake\");\n payment.setRequestedAt(LocalDateTime.now().toEpochSecond(ZoneOffset.UTC));\n// Calling the method to create a payment\nPaymentApi apiInstance = new PaymentApi(apiClient);\nString agreeSimilarTransanction = \"false\";\nPaymentDetails response = apiInstance.createPayment(payment, agreeSimilarTransanction);\n// Printing if the method call is SUCCESS, this does not mean the payment is a success\nSystem.out.println(response.getResultInfo().getCode());"
},
"preAuth": {
"python":"# Creating the payload for a payment authorization request, additional parameters can be added basis the API Documentation\nrequest_payload = {\n \"merchantPaymentId\": \"merchant_payment_id\",\n \"userAuthorizationId\": \"user_authorization_id\",\n \"amount\": {\n \"amount\": 26.00,\n \"currency\": \"JPY\"\n },\n \"requestedAt\": 1599825243,\n \"orderReceiptNumber\": \"order_receipt_num\", \n \"orderDescription\": \"Mune's Favourite Cake\",\n }\n\n# Calling the method to create a payment authorization\nresponse = client.Preauth.pre_authorize_create(request_payload)\n# Printing if the method call was SUCCESS, this does not mean the payment was a success\nprint(response['resultInfo']['code'])\n",
"php": "use PayPay\\OpenPaymentAPI\\Models\\CreatePaymentAuthPayload;\n$CPApayload = new CreatePaymentAuthPayload();\n$CPApayload->setMerchantPaymentId(uniqid('TEST_PREAUTH'))\n ->setUserAuthorizationId($this->config['uaid'])\n ->setAmount(['amount' => 20, 'currency' => 'JPY'])\n ->setRequestedAt();\n$resp = $this->client->payment->createPaymentAuth($CPApayload, true);",
"node": "const payload = {\n merchantPaymentId: 'merchant_payment_id',\n amount: {\n amount: 26.00,\n currency: 'JPY'\n },\n merchantCaptureId: \"merchant_capture_id\",\n requestedAt: 324234234,\n orderDescription: \"Mune's Favourite Cake\"\n };\n \n // Calling the method to create a capture a payment authorization\n PAYPAY.PaymentAuthCapture(payload , (response) => {\n // Printing if the method call was SUCCESS\n console.log(response);\n });",
"java": "//Creating the payload to create a Payment Authorization, additional parameters can be added basis the API Documentation\n\nPayment payment = new Payment();\npayment.setAmount(new MoneyAmount().amount(amount).currency(MoneyAmount.CurrencyEnum.JPY));\npayment.setMerchantPaymentId(\"merchant_payment_id\");\npayment.setUserAuthorizationId(\"user_authorization_id\");\npayment.setRequestedAt(Instant.now().getEpochSecond());\npayment.setOrderDescription(\"Mune's Favourite Cake\");\nString agreeSimilarTransaction = \"false\";\n\n// Calling the method to create a payment\nPaymentApi apiInstance = new PaymentApi(apiClient);\nPaymentDetails response = apiInstance.createPaymentAuthorization(payment, agreeSimilarTransaction);\n// Printing if the method call is SUCCESS, this does not mean the payment is a success\nSystem.out.println(response.getResultInfo().getCode());\n//Printing if the status is \"AUTHORIZED\"\nSystem.out.println(response.getData().getStatus());"
},
"continuousPayment": {
"python":"# Creating the payload for a payment authorization request, additional parameters can be added basis the API Documentation\nrequest_payload = {\n \"merchantPaymentId\": \"merchant_payment_id\",\n \"userAuthorizationId\": \"my_user_authorization_id\",\n \"orderDescription\":\"Mune's Favourite Cake\",\n \"amount\": {\n \"amount\": 1,\n \"currency\": \"JPY\"\n }\n }\n\n# Calling the method to create a continuous payment authorization\nresponse = client.Payment.create_continuous_payment(request_payload)\n# Printing if the method call was SUCCESS, this does not mean the payment was a success\nprint(response['resultInfo']['code'])",
"php": "$CCPPayload = new CreateContinuousPaymentPayload();\n// Save Cart totals\n$amount = [\n \"amount\" => 12,\n \"currency\" => \"JPY\"\n];\n$CCPPayload\n ->setMerchantPaymentId(uniqid('TESTMERCH_PAY_ID'))\n ->setRequestedAt()\n ->setUserAuthorizationId($this->config['uaid'])\n ->setAmount($amount);\n// Get data for QR code\n$resp = $client->payment->createContinuousPayment($CCPPayload);",
"node": "// Creating the payload for a continuous payment request, additional parameters can be added basis the API Documentation\n const payload = {\n merchantPaymentId: \"merchant_payment_id\",\n userAuthorizationId: \"user_authorization_id\",\n amount: { \n amount: 1, \n currency: \"JPY\" \n },\n requestedAt: 1587460334340,\n };\n // Calling the method to create a continuous payment \n PAYPAY.CreateSubscriptionPayment(payload, (response) => { \n // Printing if the method call was SUCCESS \n console.log(response.BODY.resultInfo.code); \n });",
"java": "// Creating the payload to create a Continuous Payment, additional parameters can be added basis the API Documentation\nPayment payment = new Payment();\npayment.setAmount(new MoneyAmount().amount(10).currency(MoneyAmount.CurrencyEnum.JPY));\npayment.setMerchantPaymentId(\"my_payment_id\");\npayment.setUserAuthorizationId(\"my_user_authorization_id\");\npayment.setOrderDescription(\"Mune's Favourite Cake\");\npayment.setRequestedAt(LocalDateTime.now().toEpochSecond(ZoneOffset.UTC));\n// Calling the method to create a continuous payment\nPaymentApi apiInstance = new PaymentApi(apiClient);\nPaymentDetails response = apiInstance.createContinuousPayment(payment);\n// Printing if the method call is SUCCESS, this does not mean the payment is a success\nSystem.out.println(response.getResultInfo().getCode());"
},
"pendingPayment": {
"python":"# Creating the payload for a payment authorization request, additional parameters can be added basis the API Documentation\nrequest_payload = {\n \"merchantPaymentId\": \"merchant_payment_id\",\n \"userAuthorizationId\": \"my_user_authorization_id\",\n \"amount\": {\n \"amount\": 1,\n \"currency\": \"JPY\"\n },\n \"requestedAt\": 01918189,\n \"expiryDate\": null,\n \"storeId\": \"store_id\",\n \"terminalId\": \"terminal_id\",\n \"orderReceiptNumber\": \"order_receipt_number\",\n \"orderDescription\":\"Example - Mune Cake shop\",\n \"orderItems\": [{\n \"name\": \"Moon cake\",\n \"category\": \"pasteries\",\n \"quantity\": 1,\n \"productId\": \"product_id\",\n \"unitPrice\": {\n \"amount\": 1,\n \"currency\": \"JPY\"\n }\n }],\n \"metadata\": {}\n}\n\n# Calling the method to create a continuous payment authorization\nclient.Pending.create_pending_payment(request_payload)\n\n# Printing if the method call was SUCCESS, this does not mean the payment was a success\nprint(response['resultInfo']['code'])",
"php": "/***\n * Initialize SDK\n */\n$CPPPayload = new CreatePendingPaymentPayload();\n// Save Cart totals\n$amount = [\n \"amount\" => rand(5, 20),\n \"currency\" => \"JPY\"\n];\n\n$CPPPayload\n ->setMerchantPaymentId(\"MERCHANT_PAYMENT_ID\")\n ->setRequestedAt()\n ->setUserAuthorizationId(\"USER_AUTH_IDENTIFIER\")\n ->setAmount($amount);\n$response = $client->payment->createPendingPayment($CPPPayload);",
"node": "// Creating the payload to create a Pending Payment, additional parameters can be added basis the API Documentation\nconst payloadPendingPayment = {\n merchantPaymentId: \"merchant_payment_id\",\n userAuthorizationId: \"user_authorization_id\",\n orderDescription: \"Mune's Favourite Cake\",\n amount: {\n amount: 10\n currency: \"JPY\"\n },\n};\n\n// Calling the method to create a pending payment \nPAYPAY.CreatePendingPayment(payloadPendingPayment, (response) => {\n // Printing if the method call was SUCCESS \n console.log(response.BODY.resultInfo.code);\n});",
"java": "//Creating the payload to create a Pending Payment, additional parameters can be added basis the API Documentation\nPayment payment = new Payment();\npayment.setAmount(new MoneyAmount().amount(amount).currency(MoneyAmount.CurrencyEnum.JPY));\npayment.setMerchantPaymentId(\"merchant_payment_id\");\npayment.setUserAuthorizationId(\"user_authorization_id\");\npayment.setOrderDescription(\"Mune's Favourite Cake\");\n\n// Calling the method to create a payment\nPendingPaymentApi apiInstance = new PendingPaymentApi(apiClient);\nPaymentDetails response = apiInstance.createPendingPayment(payment);\n// Printing if the method call is SUCCESS, this does not mean the payment is a success\nSystem.out.println(response.getResultInfo().getCode());"
}
},
"deleteDynamicQrCode": {
"python":"# Calling the method to delete a QR Code\nresponse = client.Code.delete_qr_code(\"<CodeID>\")\n# Printing if the method call was SUCCESS\nprint(response['resultInfo']['code'])",
"php": "// Calling the method to delete a QR Code\n$response = $client->code->deleteQRCode('codeId');\n// Printing if the method call was SUCCESS\nvar_dump($response['resultInfo']['code']);",
"node": "// Calling the method to delete a QR Code\n'use strict';\nconst PAYPAY = require('@paypayopa/paypayopa-sdk-node');\nPAYPAY.QRCodeDelete(Array(codeId), (response) => {\n // Printing if the method call was SUCCESS\n console.log(response.BODY.resultInfo.code);\n });",
"java": "// Calling the method to delete a QR Code\nPaymentApi apiInstance = new PaymentApi(apiClient);\nNotDataResponse response = apiInstance.deleteQRCode(\"codeId\");\n// Printing if the method call was SUCCESS\nSystem.out.println(response.getResultInfo().getCode());"
},
"getPaymentDetails": {
"default": {
"python":"# Calling the method to get payment details\nresponse = client.Code.get_payment_details(\"<merchantPaymentId>\")\n# Printing if the method call was SUCCESS, this does not mean the payment was a success\nprint(response['resultInfo']['code'])\n# Printing if the transaction status for the code has COMPLETED/ AUTHORIZED\nprint(response['data']['status'])",
"php": "/*\n.....initialize SDK\n*/\n\n$response = $client->code->getPaymentDetails('MERCHANT_PAYMENT_ID');\n$data = $response['data'];",
"node": "// Calling the method to get payment details\n'use strict';\nconst PAYPAY = require('@paypayopa/paypayopa-sdk-node');\nlet merchantPaymentId = 'merchantPaymentId';\n PAYPAY.GetCodePaymentDetails(Array(merchantPaymentId), (response) => {\n // Printing if the method call was SUCCESS, this does not mean the payment was a success\n console.log(response.BODY.resultInfo.code);\n // Printing if the transaction status for the code has COMPLETED/ AUTHORIZED\n console.log(response.BODY.data.status);\n });",
"java": "// Calling the method to get payment details\nPaymentApi apiInstance = new PaymentApi(apiClient);\nPaymentDetails response = apiInstance.getPaymentDetails(\"merchantPaymentId\");\n// Printing if the method call was SUCCESS, this does not mean the payment was a success\nSystem.out.println(response.getResultInfo().getCode());\n// Printing if the transaction status for the code has COMPLETED/ AUTHORIZED\nSystem.out.println(response.getData().getStatus());"
},
"qrCode": {
"python":"# Calling the method to get payment details\nresponse = client.Code.get_payment_details(\"<merchantPaymentId>\")\n# Printing if the method call was SUCCESS, this does not mean the payment was a success\nprint(response['resultInfo']['code'])\n# Printing if the transaction status for the code has COMPLETED/ AUTHORIZED\nprint(response['data']['status'])",
"php": "/*\n.....initialize SDK\n*/\n\n$response = $client->code->getPaymentDetails('MERCHANT_PAYMENT_ID');\n$data = $response['data'];",
"node": "const merchantPaymentId = [\"merchant_payment_id\"];\n\n// Calling the method to get payment details\nPAYPAY.GetCodePaymentDetails(merchantPaymentId, (response) => {\n // Printing if the method call was SUCCESS\n console.log(response.BODY.resultInfo.code);\n});",
"java": "// Calling the method to get payment details\nPaymentApi apiInstance = new PaymentApi(apiClient);\nPaymentDetails response = apiInstance.getCodesPaymentDetails(\"merchantPaymentId\");\n// Printing if the method call was SUCCESS, this does not mean the payment was a success\nSystem.out.println(response.getResultInfo().getCode());\n// Printing if the transaction status for the code has COMPLETED/ AUTHORIZED\nSystem.out.println(response.getData().getStatus());"
},
"pendingPayment": {
"python":"# Calling the method to get payment details\nresponse = client.Pending.get_payment_details(\"<merchantPaymentId>\")\n# Printing if the method call was SUCCESS, this does not mean the payment was a success\nprint(response['resultInfo']['code'])\n# Printing if the transaction status for the code has COMPLETED/ AUTHORIZED\nprint(response['data']['status'])",
"php": "/*\n.....initialize SDK\n*/\n\n$paymentDetails = $client->code->getPaymentDetails(\"MERCHANT_PAYMENT_ID\", 'pending');",
"node": "// Calling the method to get payment details\n'use strict';\nconst PAYPAY = require('@paypayopa/paypayopa-sdk-node');\nlet merchantPaymentId = 'merchantPaymentId';\n PAYPAY.GetPaymentDetails(Array(merchantPaymentId), (response) => {\n // Printing if the method call was SUCCESS, this does not mean the payment was a success\n console.log(response.BODY.resultInfo.code);\n // Printing if the transaction status for the code has COMPLETED/ AUTHORIZED\n console.log(response.BODY.data.status);\n });",
"java": "// Calling the method to get payment details\nPendingPaymentApi apiInstance = new PendingPaymentApi(apiClient);\nPaymentDetails response = apiInstance.getPaymentDetails(\"merchantPaymentId\");\n// Printing if the method call was SUCCESS, this does not mean the payment was a success\nSystem.out.println(response.getResultInfo().getCode());\n// Printing if the transaction status for the code is CREATED\nSystem.out.println(response.getData().getStatus());"
}
},
"cancelPayment": {
"default": {
"python":"# Calling the method to cancel a Payment\nresponse = client.Payment.cancel_payment(\"<merchantPaymentId>\")\n# Printing if the method call was SUCCESS\nprint(response['resultInfo']['code'])",
"php": "// Calling the method to cancel a Payment\n $response = $client->payment->cancelPayment('merchantPaymentId');\n// Printing if the method call was SUCCESS\nvar_dump($response['resultInfo']['code']);",
"node": "// Calling the method to cancel a Payment\n 'use strict';\nconst PAYPAY = require('@paypayopa/paypayopa-sdk-node');\n PAYPAY.PaymentCancel(Array(merchantPaymentId), (response) => {\n console.log(result);\n // Printing if the method call was SUCCESS\n console.log(response.BODY.resultInfo.code);\n });",
"java": "// Calling the method to cancel a Payment\nPaymentApi apiInstance = new PaymentApi(apiClient);\nNotDataResponse response = apiInstance.cancelPayment(\"merchantPaymentId\");\n// Printing if the method call was SUCCESS\nSystem.out.println(response.getResultInfo().getCode());"
},
"pendingPayment": {
"python":"# Calling the method to cancel pending payment\nresponse = client.Pending.cancel_payment(\"<merchantPaymentId>\")\n# Printing if the method call was SUCCESS, this does not mean the payment was a success\nprint(response['resultInfo']['code'])\n# Printing if the transaction status for the code has COMPLETED/ AUTHORIZED\nprint(response['data']['status'])\n",
"php": "/**\n * Initialize the SDK\n */\n$response = $client->payment->cancelPayment(\"MERCHANT_PAYMENT_ID\");",
"node": "const merchantPaymentId = [\"merchant_payment_id\"];\n\n// Calling the method to cancel a pending order\nPAYPAY.CancelPendingOrder(merchantPaymentId, (response) => {\n // Printing if the method call was SUCCESS\n console.log(response.BODY.resultInfo.code);\n});",
"java": "// Calling the method to cancel a pending order\nPendingPaymentApi apiInstance = new PendingPaymentApi(apiClient);\nNotDataResponse response = apiInstance.cancelPendingOrder(\"merchantPaymentId\");\n// Printing if the method call was SUCCESS\nSystem.out.println(response.getResultInfo().getCode());"
}
},
"capturePayment": {
"python": "# Creating the payload to capture a Payment Authorization, additional parameters can be added basis the API Documentation\nrequest_payload = {\n \"merchantPaymentId\": \"merchant_payment_id\",\n \"amount\": {\n \"amount\": 1,\n \"currency\": \"JPY\"\n },\n merchantCapture_id: \"merchant_capture_id\",\n orderDescription: \"Example - Mune Cake shop\"\n}\n# Calling the method to Capture a Payment Authorization\nresponse = client.Payment.capture_payment(request_payload)\n# Printing if the method call was SUCCESS\nprint(response['resultInfo']['code'])",
"php": "use PayPay\\OpenPaymentAPI\\Models\\CapturePaymentAuthPayload;\n/*\n.....initialize SDK\n*/\n// setup payment object\n$CAPayload = new CapturePaymentAuthPayload();\n$CAPayload->setMerchantPaymentId(\"YOUR_TRANSACTION_ID\");\n$amount = [\n \"amount\" => 1,\n \"currency\" => \"JPY\"\n];\n$CAPayload->setAmount($amount);\n\n$CAPayload->setMerchantCaptureId(\"MERCHANT_CAPTURE_ID\")\n$CAPayload->setRequestedAt();\n$CAPayload->setOrderDescription(\"ORDER_DESCRIPTION\")\n$CAPayload->setCodeType(\"ORDER_QR\");\n$response = $client->payment->capturePaymentAuth($CAPayload);\n\n$data = $response['data'];",
"node": "// Creating the payload to capture a Payment Authorization, additional parameters can be added basis the API Documentation\n'use strict';\nconst PAYPAY = require('@paypayopa/paypayopa-sdk-node');\n let payload = {\n merchantPaymentId: 'merchant_payment_id',\n amount: {\n amount: 1,\n currency: 'JPY',\n },\n merchantCaptureId: 'merchant_capture_id',\n requestedAt: 1587460334340,\n orderDescription: 'Order Shipped, Cake with toppings',\n };\n // Calling the method to Capture a Payment Authorization\n PAYPAY.PaymentAuthCapture(payload, (response) => {\n // Printing if the method call was SUCCESS\n console.log(response.BODY.resultInfo.code);\n });",
"java": "// Creating the payload to capture a Payment Authorization, additional parameters can be added basis the API Documentation\nCaptureObject captureObject = new CaptureObject();\n captureObject.setMerchantCaptureId(\"merchant_capture_id\");\n captureObject.setMerchantPaymentId(\"merchant_payment_id\");\n captureObject.setAmount(new MoneyAmount().amount(1).currency(MoneyAmount.CurrencyEnum.JPY));\n captureObject.setOrderDescription(\"Order Shipped, Cake with toppings\");\n captureObject.setRequestedAt(Instant.now().getEpochSecond());\n\n// Calling the method to Capture a Payment Authorization\nPaymentApi apiInstance = new PaymentApi(apiClient);\nPaymentDetails response = apiInstance.capturePaymentAuth(captureObject);\n// Printing if the method call was SUCCESS\nSystem.out.println(response.getResultInfo().getCode());"
},
"revertPayment": {
"default": {
"python": "# Creating the payload to revert a Payment Authorization, additional paramexters can be added basis the API Documentation\nrequest_payload = {\n \"merchantRevertId\": \"merchant_revert_id\",\n \"paymentId\": \"paypay_payment_id\",\n \"reason\": \"reason for refund\"\n}\n# Calling the method to Revert a Payment Authorization\nresponse = client.Payment.revert_payment(request_payload)\n# Printing if the method call was SUCCESS\nprint(response['resultInfo']['code'])",
"php": "use PayPay\\OpenPaymentAPI\\Models\\RevertAuthPayload;\n/*\n.....initialize SDK\n*/\n// setup payment object\n$RAPayload = new RevertAuthPayload();\n$RAPayload->setMerchantRevertId(\"UNIQUE_REVERT_ID\");\n$RAPayload->setPaymentId(\"MERCHANT_PAYMENT_ID\");\n$RAPayload->setRequestedAt();\n$RAPayload->setReason(\"REASON_FOR_REFUND\");\n \n $response = $client->payment->revertAuth($RAPayload)",
"node": "// Creating the payload to revert a Payment Authorization, additional parameters can be added basis the API Documentation\n'use strict';\nconst PAYPAY = require('@paypayopa/paypayopa-sdk-node');\nlet payload = {\n merchantRevertId: 'merchant_revert_id',\n paymentId: 'paypay_payment_id',\n reason: 'reason for revert',\n };\n // Calling the method to Revert a Payment Authorization\n PAYPAY.PaymentAuthRevert(payload, (response) => {\n // Printing if the method call was SUCCESS\n console.log(response.BODY.resultInfo.code);\n });",
"java": "// Creating the payload to revert a Payment Authorization, additional parameters can be added basis the API Documentation\nPaymentStateRevert payment = new PaymentStateRevert();\n payment.setPaymentId(\"paypay_payment_id\");\n payment.setMerchantRevertId(\"merchant_revert_id\");\n payment.setRequestedAt(Instant.now().getEpochSecond());\n payment.setReason(\"reason to revert\");\n\n// Calling the method to Revert a Payment Authorization\nPaymentApi apiInstance = new PaymentApi(apiClient);\nRevertAuthResponse response = apiInstance.revertAuth(payment);\n// Printing if the method call was SUCCESS\nSystem.out.println(response.getResultInfo().getCode());"
},
"preAuth": {
"python": "# Creating the payload to revert a Payment Authorization, additional paramexters can be added basis the API Documentation\nrequest_payload = {\n \"merchantRevertId\": \"merchant_revert_id\",\n \"paymentId\": \"paypay_payment_id\",\n \"reason\": \"reason for refund\"\n}\n# Calling the method to Revert a Payment Authorization\nresponse = client.Payment.revert_payment(request_payload)\n# Printing if the method call was SUCCESS\nprint(response['resultInfo']['code'])",
"php": "use PayPay\\OpenPaymentAPI\\Models\\RevertAuthPayload;\n$RAPayload = new RevertAuthPayload();\n$RAPayload->setMerchantRevertId(uniqid('TESTMERCH_REV_ID'))\n ->setPaymentId($paymentId)\n ->setRequestedAt();\n$resp = $this->client->payment->revertAuth($RAPayload);",
"node": "// Creating the payload to revert a Payment Authorization, additional parameters can be added basis the API Documentation\n'use strict';\nconst PAYPAY = require('@paypayopa/paypayopa-sdk-node');\nlet payload = {\n merchantRevertId: 'merchant_revert_id',\n paymentId: 'paypay_payment_id',\n reason: 'reason for revert',\n };\n // Calling the method to Revert a Payment Authorization\n PAYPAY.PaymentAuthRevert(payload, (response) => {\n // Printing if the method call was SUCCESS\n console.log(response.BODY.resultInfo.code);\n });",
"java": "// Creating the payload to revert a Payment Authorization, additional parameters can be added basis the API Documentation\nPaymentStateRevert payment = new PaymentStateRevert();\n payment.setPaymentId(\"paypay_payment_id\");\n payment.merchantRevertId(\"merchant_revert_id\");\n payment.setRequestedAt(Instant.now().getEpochSecond());\n payment.setReason(\"reason to revert\");\n\n// Calling the method to Revert a Payment Authorization\nPaymentApi apiInstance = new PaymentApi(apiClient);\nRevertAuthResponse response = apiInstance.revertAuth(payment);\n// Printing if the method call was SUCCESS\nSystem.out.println(response.getResultInfo().getCode());"
}
},
"refundPayment": {
"default": {
"python": "# Creating the payload to refund a Payment, additional parameters can be added basis the API Documentation\n\npayload = {\n \"assumeMerchant\": \"assume_merchant\",\n \"merchantRefundId\": \"merchant_refund_id\",\n \"paymentId\": \"paypay_payment_id\",\n \"amount\": {\n \"amount\": 1,\n \"currency\": \"JPY\"\n },\n \"reason\": \"reason for refund\"\n}\n\n# Calling the method to refund a Payment\nresponse = client.Pending.refund_payment(payload)\n# Printing if the method call was SUCCESS\nprint(response['resultInfo']['code'])",
"php": "/**\n * Bootstrap client\n */\n$amount = [\n \"amount\" => 1,\n \"currency\" => \"JPY\"\n];\n$RPPayload = new RefundPaymentPayload();\n$RPPayload\n->setMerchantRefundId(\"UNIQUE_REFUND_ID\")\n->setPaymentId(\"PAYPAY_PAYMENT_ID\")\n->setAmount($amount)\n->setRequestedAt();//Leave empty for current time and pass DateTime specify exact time\n$resp = $this->client->refund->refundPayment($RPPayload);",
"node": "'use strict';\nconst PAYPAY = require('@paypayopa/paypayopa-sdk-node');\n let payload = {\n merchantRefundId: 'merchant_refund_id',\n paymentId: 'paypay_payment_id',\n amount: {\n amount: 1,\n currency: 'JPY',\n },\n reason: 'reason for refund',\n };\n// Calling the method to refund a Payment\nPAYPAY.PaymentRefund(payload, (response) => {\n // Printing if the method call was SUCCESS\n console.log(response.BODY.resultInfo.code);\n });",
"java": "// Creating the payload to refund a Payment, additional parameters can be added basis the API Documentation\nRefund refund = new Refund();\n refund.setAmount(new MoneyAmount().amount(1).currency(MoneyAmount.CurrencyEnum.JPY));\n refund.setMerchantRefundId(\"merchant_refund_id\");\n refund.setPaymentId(\"paypay_payment_id\");\n refund.setRequestedAt(LocalDateTime.now().toEpochSecond(ZoneOffset.UTC));\n refund.setReason(\"reason for refund\");\n\n// Calling the method to refund a Payment\nPaymentApi apiInstance = new PaymentApi(apiClient);\nRefundDetails response = apiInstance.refundPayment(refund);\n// Printing if the method call was SUCCESS\nSystem.out.println(response.getResultInfo().getCode());"
},
"pendingPayment": {
"python": "# Creating the payload to refund a Payment, additional parameters can be added basis the API Documentation\n\npayload = {\n \"assumeMerchant\": \"assume_merchant\",\n \"merchantRefundId\": \"merchant_refund_id\",\n \"paymentId\": \"paypay_payment_id\",\n \"amount\": {\n \"amount\": 1,\n \"currency\": \"JPY\"\n },\n \"reason\": \"reason for refund\"\n}\n\n# Calling the method to refund a Payment\nresponse = client.Pending.refund_payment(payload)\n# Printing if the method call was SUCCESS\nprint(response['resultInfo']['code'])",
"php": "/**\n * Initialize the SDK\n * \n */\n// Save Cart totals\n$amount = [\n \"amount\" => 2,\n \"currency\" => \"JPY\"\n];\n$RPPayload = new RefundPaymentPayload();\n$RPPayload\n ->setMerchantRefundId(\"MERCHANT_REFUND_ID\")\n ->setPaymentId(\"PAYPAY_PAYMENT_IDENTIFIER\")\n ->setAmount($amount)\n ->setRequestedAt();\n$response = $client->refund->refundPayment($RPPayload, 'pending');",
"node": "// Creating the payload to refund a Payment, additional parameters can be added basis the API Documentation\nconst payloadRefundPayment = {\n merchantRefundId: \"merchant_refund_id\",\n paymentId: \"paypay_payment_id\",\n amount: {\n amount: 10,\n currency: \"JPY\"\n },\n reason: \"reason for refund\"\n}\n\n// Calling the method to refund a Payment\nPAYPAY.RefundPendingPayment(payloadRefundPayment , (response) => {\n // Printing if the method call was SUCCESS\n console.log(response.BODY.resultInfo.code);\n});",
"java": "// Creating the payload to refund a Payment, additional parameters can be added basis the API Documentation\nRefund refund = new Refund();\n refund.setAmount(new MoneyAmount().amount(1).currency(MoneyAmount.CurrencyEnum.JPY));\n refund.setMerchantRefundId(\"merchant_refund_id\");\n refund.setPaymentId(\"paypay_payment_id\");\n refund.setReason(\"reason for refund\");\n// Calling the method to refund a Payment\nPendingPaymentApi apiInstance = new PendingPaymentApi(apiClient);\nRefundDetails response = apiInstance.refundPayment(refund);\n// Printing if the method call was SUCCESS\nSystem.out.println(response.getResultInfo().getCode());"
}
},
"fetchRefundPayment": {
"default": {
"python": "# Calling the method to get Refund Details\nresponse = client.Payment.refund_status(\"<merchantRefundId>\")\n# Printing if the method call was SUCCESS\nprint(response['resultInfo']['code'])",
"php": "// Calling the method to get Refund Details\n$response=$client->refund->getRefundDetails('merchantRefundId');\n// Printing if the method call was SUCCESS\nvar_dump($response['resultInfo']['code']);",
"node": "// Calling the method to get Refund Details\n'use strict';\nconst PAYPAY = require('@paypayopa/paypayopa-sdk-node');\nlet merchantPaymentId = 'merchantRefundId'\nPAYPAY.GetRefundDetails(Array(merchantRefundId), (response) => {\n // Printing if the method call was SUCCESS\n console.log(response.BODY.resultInfo.code);\n });",
"java": "// Calling the method to get Refund Details\nPaymentApi apiInstance = new PaymentApi(apiClient);\nRefundDetails response = apiInstance.getRefundDetails(\"merchantRefundId\");\n// Printing if the method call was SUCCESS\nSystem.out.println(response.getResultInfo().getCode());"
},
"pendingPayment": {
"python": "# Calling the method to cancel pending payment\nresponse = client.Pending.refund_details(\"<merchantPaymentId>\")\n# Printing if the method call was SUCCESS, this does not mean the payment was a success\nprint(response['resultInfo']['code'])\n# Printing if the transaction status for the code has COMPLETED/ AUTHORIZED\nprint(response['data']['status'])",
"php": "/**\n * Initialize the SDK\n */\n$response = $client->refund->getRefundDetails(\"MERCHANT_REFUND_ID\");",
"node": "const merchantRefundId = [\"merchant_refund_id\"];\n\n // Calling the method to get Refund Details\n PAYPAY.GetRefundDetails(merchantRefundId, (response) => {\n // Printing if the method call was SUCCESS\n console.log(response);\n });",
"java": "// Calling the method to get Refund Details\nPendingPaymentApi apiInstance = new PendingPaymentApi(apiClient);\nRefundDetails response = apiInstance.getRefundDetails(\"merchantRefundId\");\n// Printing if the method call was SUCCESS\nSystem.out.println(response.getResultInfo().getCode());"
}
},
"userAuthStatus": {
"python": "# Calling the method to get user authorization status\nresponse = client.User.get_authorization_status(\"<userAuthorizationId>\")\n# Printing if the method call was SUCCESS\nprint(response['resultInfo']['code'])",
"php": "/*\n.....initialize SDK\n*/\n\n$response = $client->user->getUserAuthorizationStatus('userAuthorizationId');\nvar_dump($response['resultInfo']['code']);",
"node": "// Calling the method to get user authorization status\n'use strict';\nconst PAYPAY = require('@paypayopa/paypayopa-sdk-node');\nlet userAuthorizationId = 'userAuthorizationid';\n PAYPAY.getUserAuthorizationStatus(userAuthorizationId, (response) => {\n // Printing if the method call was SUCCESS\n console.log(response.BODY.resultInfo.code);\n });",
"java": "// Calling the method to get user authorization status\nUserApi userApi = new UserApi(apiClient);\nUserAuthorizationStatus response = userApi.getUserAuthorizationStatus(\"userAuthorizationId\");\n// Printing if the method call was SUCCESS\nSystem.out.println(response.getResultInfo().getCode());"
},
"unlinkUser": {
"python": "# Calling the method to unlink the user from the client\nresponse = client.User.unlink_user_athorization(\"<userAuthorizationId>\")\n# Printing if the method call was SUCCESS\nprint(response['resultInfo']['code'])",
"php": "/*\n.....initialize SDK\n*/\n\n$response = $client->user->unlinkUser('userAuthorizationId');\nvar_dump($response['resultInfo']['code']);",
"node": "// Calling the method to unlink the user from the client\n'use strict';\nconst PAYPAY = require('@paypayopa/paypayopa-sdk-node');\nlet userAuthorizationId = 'userAuthorizationid';\n PAYPAY.unlinkUser(userAuthorizationId, (response) => {\n // Printing if the method call was SUCCESS\n console.log(response.BODY.resultInfo.code);\n });",
"java": "// Calling the method to unlink the user from the client\nUserApi userApi = new UserApi(apiClient);\nNotDataResponse response = userApi.unlinkUser(\"userAuthorizationId\");\n// Printing if the method call was SUCCESS\nSystem.out.println(response.getResultInfo().getCode());"
},
"webhookNotifications": {
"python": "{\n \"notification_type\":\"file.created\",\n \"notification_id\":\"<UUID>\",\n \"fileType\":\"transaction_recon\",\n \"path\":\"https:\/\/<server_path>\/<filename>?parameters\",\n \"requestedAt\":\"<epoch time>\"\n}",
"php": "{\n \"notification_type\":\"file.created\",\n \"notification_id\":\"<UUID>\",\n \"fileType\":\"transaction_recon\",\n \"path\":\"https:\/\/<server_path>\/<filename>?parameters\",\n \"requestedAt\":\"<epoch time>\"\n}",
"node": "{\n \"notification_type\":\"file.created\",\n \"notification_id\":\"<UUID>\",\n \"fileType\":\"transaction_recon\",\n \"path\":\"https:\/\/<server_path>\/<filename>?parameters\",\n \"requestedAt\":\"<epoch time>\"\n}",
"java": "{\n \"notification_type\":\"file.created\",\n \"notification_id\":\"<UUID>\",\n \"fileType\":\"transaction_recon\",\n \"path\":\"https:\/\/<server_path>\/<filename>?parameters\",\n \"requestedAt\":\"<epoch time>\"\n}"
}
}
}